| 1 | --- ffmpegaudio.cc.orig 2013-06-06 06:39:06.000000000 -0700 |
| 2 | +++ ffmpegaudio.cc 2016-04-21 12:06:50.000000000 -0700 |
| 3 | @@ -326,7 +326,11 @@ |
| 4 | |
| 5 | bool DecoderContext::play( QString & errorString ) |
| 6 | { |
| 7 | +#if LIBAVCODEC_VERSION_MAJOR < 55 || ( LIBAVCODEC_VERSION_MAJOR == 55 && LIBAVCODEC_VERSION_MINOR < 28 ) |
| 8 | AVFrame * frame = avcodec_alloc_frame(); |
| 9 | +#else |
| 10 | + AVFrame * frame = av_frame_alloc(); |
| 11 | +#endif |
| 12 | if ( !frame ) |
| 13 | { |
| 14 | errorString = QObject::tr( "avcodec_alloc_frame() failed." ); |
| 15 | @@ -348,7 +352,11 @@ |
| 16 | } |
| 17 | } |
| 18 | // av_free_packet() must be called after each call to av_read_frame() |
| 19 | +#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 ) |
| 20 | av_free_packet( &packet ); |
| 21 | +#else |
| 22 | + av_packet_unref( &packet ); |
| 23 | +#endif |
| 24 | } |
| 25 | |
| 26 | if ( !isCancelled_ && codecContext_->codec->capabilities & CODEC_CAP_DELAY ) |
| 27 | @@ -365,8 +373,10 @@ |
| 28 | |
| 29 | #if LIBAVCODEC_VERSION_MAJOR < 54 |
| 30 | av_free( frame ); |
| 31 | -#else |
| 32 | +#elif LIBAVCODEC_VERSION_MAJOR < 55 || ( LIBAVCODEC_VERSION_MAJOR == 55 && LIBAVCODEC_VERSION_MINOR < 28 ) |
| 33 | avcodec_free_frame( &frame ); |
| 34 | +#else |
| 35 | + av_frame_free( &frame ); |
| 36 | #endif |
| 37 | |
| 38 | return true; |