diff options
Diffstat (limited to 'src/combined/ffmpeg')
-rw-r--r-- | src/combined/ffmpeg/ff_audio_decoder.c | 10 | ||||
-rw-r--r-- | src/combined/ffmpeg/ff_video_decoder.c | 12 | ||||
-rw-r--r-- | src/combined/ffmpeg/ffmpeg_compat.h | 11 |
3 files changed, 22 insertions, 11 deletions
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c index e0cdb78b5..aa8c674ab 100644 --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -1117,11 +1117,11 @@ static void ff_audio_dispose (audio_decoder_t *this_gen) { free16 (this->buf); free16 (this->decode_buffer); - if(this->context && this->context->extradata) - free(this->context->extradata); - - if(this->context) - av_free(this->context); + if (this->context) { + _x_freep (&this->context->extradata); + this->context->extradata_size = 0; + avcodec_free_context (&this->context); + } free (this_gen); } diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 8a449378e..33e3fd17a 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -2474,14 +2474,14 @@ static void ff_dispose (video_decoder_t *this_gen) { if (this->slice_offset_table) free (this->slice_offset_table); - if(this->context && this->context->extradata) - free(this->context->extradata); - - if( this->context ) - av_free( this->context ); + if (this->context) { + _x_freep (&this->context->extradata); + this->context->extradata_size = 0; + avcodec_free_context (&this->context); + } if( this->av_frame ) - av_free( this->av_frame ); + avcodec_free_frame( &this->av_frame ); if (this->buf) free(this->buf); diff --git a/src/combined/ffmpeg/ffmpeg_compat.h b/src/combined/ffmpeg/ffmpeg_compat.h index edd01ddba..4d9d66bf0 100644 --- a/src/combined/ffmpeg/ffmpeg_compat.h +++ b/src/combined/ffmpeg/ffmpeg_compat.h @@ -205,4 +205,15 @@ # define AV_BUFFER 1 #endif +#if LIBAVCODEC_VERSION_INT < AV_INT_VERSION(55,63,100) +# define avcodec_free_context(pp) av_free(*(pp)) +#endif + +#if LIBAVCODEC_VERSION_INT < AV_INT_VERSION(54,59,100) +# define avcodec_free_frame(pp) av_free(*(pp)) +#elif LIBAVCODEC_VERSION_INT >= AV_INT_VERSION(55,45,101) +# define avcodec_alloc_frame() av_frame_alloc() +# define avcodec_free_frame(pp) av_frame_free(pp) +#endif + #endif /* XINE_AVCODEC_COMPAT_H */ |