]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/utils: clear the packet props queue on flushing
authorJames Almer <jamrial@gmail.com>
Mon, 9 Nov 2020 13:12:59 +0000 (10:12 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 9 Nov 2020 18:57:56 +0000 (15:57 -0300)
This ensures no queued timestamps or side data are kept and used after
seeking, preventing potential desyncs.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/utils.c

index c10539593e9baaa5aa26f72383fbbd78debba128..9b074e2ddaf9f554b5285fdff88fdfe399254db6 100644 (file)
@@ -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);