summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-10-22 13:33:44 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-10-23 13:25:51 +0200
commit6f5b4ce612d42a152cd0dea104e4f1502a1f1952 (patch)
treebd9f2b8686fe87f0ae8697b200a8b598e6a668ab /libavcodec/vp3.c
parent1ac5b51203d03e143bcf186ee43704243e363589 (diff)
Reuse vp3_decode_flush instead of duplicating it.
This also fixes that sometimes a frame would actually not be freed. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 82838de61e..77a3151b45 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1980,6 +1980,8 @@ error:
return -1;
}
+static void vp3_decode_flush(AVCodecContext *avctx);
+
/*
* This is the ffmpeg/libavcodec API module cleanup function.
*/
@@ -2017,12 +2019,7 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
free_vlc(&s->motion_vector_vlc);
/* release all frames */
- if (s->golden_frame.data[0])
- ff_thread_release_buffer(avctx, &s->golden_frame);
- if (s->last_frame.data[0] && s->last_frame.type != FF_BUFFER_TYPE_COPY)
- ff_thread_release_buffer(avctx, &s->last_frame);
- /* no need to release the current_frame since it will always be pointing
- * to the same frame as either the golden or last frame */
+ vp3_decode_flush(avctx);
return 0;
}