From ae116f8511fed68ebb93bc36f5518cc1dba33f43 Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Thu, 7 Nov 2013 16:56:20 +0100 Subject: video_dec_libvpx: flush undisplayed frames on reset. --- src/video_dec/libvpx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/video_dec/libvpx.c b/src/video_dec/libvpx.c index eafd0e315..eb8ac02b5 100644 --- a/src/video_dec/libvpx.c +++ b/src/video_dec/libvpx.c @@ -213,6 +213,17 @@ static void vpx_reset (video_decoder_t *this_gen) { vpx_decoder_t *this = (vpx_decoder_t *) this_gen; + if (this->decoder_ok) { + const void *iter = NULL; + while (1) { + struct vpx_image *img = vpx_codec_get_frame(&this->ctx, &iter); + if (!img) + break; + free(img->user_priv); + img->user_priv = NULL; + } + } + this->size = 0; } -- cgit v1.2.3