[FFmpeg-cvslog] avcodec/utils: clear the packet props queue on flushing

James Almer git at videolan.org
Mon Nov 9 20:59:21 EET 2020


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Nov  9 10:12:59 2020 -0300| [d2dcb113f8e4e6e372007a354a600e6c2579ea8b] | committer: James Almer

avcodec/utils: clear the packet props queue on flushing

This ensures no queued timestamps or side data are kept and used after
seeking, preventing potential desyncs.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d2dcb113f8e4e6e372007a354a600e6c2579ea8b
---

 libavcodec/utils.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c10539593e..9b074e2dda 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1093,6 +1093,10 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
     av_packet_unref(avci->compat_encode_packet);
     av_packet_unref(avci->buffer_pkt);
 
+    av_packet_unref(avci->last_pkt_props);
+    avpriv_packet_list_free(&avci->pkt_props,
+                            &avci->pkt_props_tail);
+
     av_frame_unref(avci->es.in_frame);
     av_packet_unref(avci->ds.in_pkt);
 



More information about the ffmpeg-cvslog mailing list