rbouqueau / gpac

GPAC mirror from the SourceForge Subversion
GNU Lesser General Public License v2.1
0 stars 1 forks source link

[Bug] Bad libav* version checks in ffmpeg_in module [sf#326] #326

Closed rbouqueau closed 10 years ago

rbouqueau commented 10 years ago

Reported by jgrennison on 2014-08-12 11:24 UTC In modules/ffmpeg_in/ffmpeg_demux.c there is a test:

if ((LIBAVFORMAT_VERSION_MAJOR == 54) && (LIBAVFORMAT_VERSION_MINOR >= 20))

This fails for current ffmpeg, which is 56.0 There is a similarly fragile test in ffmpeg_decode.c.

This #if block defines FF_API_FORMAT_PARAMETERS if it is not already set, however in current ffmpeg it is effectively already defined to 0, so it can't be used to determine whether to use avformat_open_input or av_open_input_stream later on in the file. It is probably a better idea to use a separate define which is set within that test instead.

See attached patch for some possible fixes.

Additionally, there are a number of tests like:

if (LIBAVCODEC_VERSION_MAJOR <= 52) && (LIBAVCODEC_VERSION_MINOR <= 20)

in modules/ts_muxer which may break with very old versions of ffmpeg (ie. major <= 52, minor > 20).

rbouqueau commented 10 years ago

Commented by rbouqueau on 2014-08-13 16:48 UTC Thanks for the patch. Now that you point it, the comparisons are obviously wrong. I'm going to apply the patch when I find time (unless you want to take care of all the comparisons which would be highly appreciated :) ). I'll let you know here.

rbouqueau commented 10 years ago

Commented by jgrennison on 2014-08-14 11:01 UTC OK, I've updated the patch with fixes for the other tests.

The tests around guess_stream_format/av_guess_format didn't really make sense, so I fixed those to point to when av_guess_format was introduced during 52.47.

rbouqueau commented 10 years ago

Commented by rbouqueau on 2014-08-21 20:07 UTC Thank you very much! This was applied as commit 5361: https://sourceforge.net/p/gpac/code/5361/

Romain

rbouqueau commented 10 years ago

Updated by rbouqueau on 2014-08-21 20:07 UTC