summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index 11f07565c..1b588a47b 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -264,7 +264,7 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){
av_frame->reordered_opaque = context->reordered_opaque;
#endif
- xine_list_push_back(this->dr1_frames, av_frame);
+ xine_list_push_back(this->dr1_frames, img);
return 0;
}
@@ -281,10 +281,11 @@ static void release_buffer(struct AVCodecContext *context, AVFrame *av_frame){
xine_list_iterator_t it;
- it = xine_list_find(this->dr1_frames, av_frame);
+ it = xine_list_find(this->dr1_frames, av_frame->opaque);
assert(it);
- if( it != NULL )
+ if( it != NULL ) {
xine_list_remove(this->dr1_frames, it);
+ }
} else {
avcodec_default_release_buffer(context, av_frame);
}
@@ -1735,7 +1736,6 @@ static void ff_reset (video_decoder_t *this_gen) {
if(this->context && this->decoder_ok)
{
xine_list_iterator_t it;
- AVFrame *av_frame;
avcodec_flush_buffers(this->context);
@@ -1743,8 +1743,9 @@ static void ff_reset (video_decoder_t *this_gen) {
* don't release their DR1 frames */
while( (it = xine_list_front(this->dr1_frames)) != NULL )
{
- av_frame = (AVFrame *)xine_list_get_value(this->dr1_frames, it);
- release_buffer(this->context, av_frame);
+ vo_frame_t *img = (vo_frame_t *)xine_list_get_value(this->dr1_frames, it);
+ if (img)
+ img->free(img);
}
xine_list_clear(this->dr1_frames);
}
@@ -1809,7 +1810,6 @@ static void ff_dispose (video_decoder_t *this_gen) {
if (this->decoder_ok) {
xine_list_iterator_t it;
- AVFrame *av_frame;
pthread_mutex_lock(&ffmpeg_lock);
avcodec_close (this->context);
@@ -1819,8 +1819,9 @@ static void ff_dispose (video_decoder_t *this_gen) {
* don't release their DR1 frames */
while( (it = xine_list_front(this->dr1_frames)) != NULL )
{
- av_frame = (AVFrame *)xine_list_get_value(this->dr1_frames, it);
- release_buffer(this->context, av_frame);
+ vo_frame_t *img = (vo_frame_t *)xine_list_get_value(this->dr1_frames, it);
+ if (img)
+ img->free(img);
}
this->stream->video_out->close(this->stream->video_out, this->stream);