mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
1ac5b51203
commit
6f5b4ce612
|
@ -1980,6 +1980,8 @@ error:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void vp3_decode_flush(AVCodecContext *avctx);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the ffmpeg/libavcodec API module cleanup function.
|
* 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);
|
free_vlc(&s->motion_vector_vlc);
|
||||||
|
|
||||||
/* release all frames */
|
/* release all frames */
|
||||||
if (s->golden_frame.data[0])
|
vp3_decode_flush(avctx);
|
||||||
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 */
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue