[FFmpeg-devel] [PATCH] fix inclusion of avformat.h in avio.h

Diego Biurrun diego
Thu Feb 19 01:15:08 CET 2009

On Wed, Feb 18, 2009 at 12:37:50PM +0100, Benoit Fouet wrote:
> as LIBAVFORMAT_VERSION_MAJOR is used in avio.h, the latter needs to
> include avformat.h
> so far, so good...
> the "problem" is that avformat.h includes avio.h, so the only way to do
> it (simply) is to include avformat.h in avio.h *before* its multiple
> inclusion guards.

I also looked into this before, 'make checkheaders' spits out a bunch of
warnings about the issue.  It's a problem, the two headers have circular
dependencies on each other.

We could wait for the next major version bump (after the release?), after
that we can remove the deprecated functions along with the problematic
preprocessor conditions and the #include.  Of course the problem would
reappear with the next deprecated function...

> --- libavformat/avio.h	(revision 17427)
> +++ libavformat/avio.h	(working copy)
> @@ -18,6 +18,9 @@
>   * License along with FFmpeg; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> +
> +#include "avformat.h"
> +
>  #ifndef AVFORMAT_AVIO_H
>  #define AVFORMAT_AVIO_H

At the very least, this should have an explanatory comment.


More information about the ffmpeg-devel mailing list