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

Benoit Fouet benoit.fouet
Thu Feb 19 09:24:40 CET 2009


On 02/19/2009 01:15 AM, Diego Biurrun wrote:
> 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...
>
>   

that means this is not the right solution. You'll have a release in the
wild with no possibility of including avio.h without avformat.h before.

>> --- 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.
>
>   

like that ?
/*
 * Need to include avformat.h before the inclusion guards, because of
 * a circular dependency between avformat.h and avio.h.
 */

-- 
Ben





More information about the ffmpeg-devel mailing list