diff mbox series

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

Message ID 20201109131341.1699-1-jamrial@gmail.com
State Accepted
Commit d2dcb113f8e4e6e372007a354a600e6c2579ea8b
Headers show
Series [FFmpeg-devel] avcodec/utils: clear the packet props queue on flushing | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

James Almer Nov. 9, 2020, 1:13 p.m. UTC
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 | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jan Ekström Nov. 9, 2020, 5:20 p.m. UTC | #1
On Mon, Nov 9, 2020 at 4:16 PM James Almer <jamrial@gmail.com> wrote:
>
> 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>
> ---

I can verify this patch fixes seeking issues reported downstream with
ASF+WMApro.

Patchwork also shows FATE green, although we only have a few seek
tests and I'm not sure if they decode in the middle.

Jan
James Almer Nov. 9, 2020, 6:56 p.m. UTC | #2
On 11/9/2020 2:20 PM, Jan Ekström wrote:
> On Mon, Nov 9, 2020 at 4:16 PM James Almer <jamrial@gmail.com> wrote:
>>
>> 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>
>> ---
> 
> I can verify this patch fixes seeking issues reported downstream with
> ASF+WMApro.
> 
> Patchwork also shows FATE green, although we only have a few seek
> tests and I'm not sure if they decode in the middle.

Will apply, thanks.
diff mbox series

Patch

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index db51512e15..a8599b3936 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);