diff mbox series

[FFmpeg-devel,1/5] avcodec/binkaudio: clear pts when returning more than one frame per input packet

Message ID 20221204215227.4186-1-jamrial@gmail.com
State Accepted
Commit 8dcb8d1b808d4f8cd6444de05d8277b2e7959144
Headers show
Series [FFmpeg-devel,1/5] avcodec/binkaudio: clear pts when returning more than one frame per input packet | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Dec. 4, 2022, 9:52 p.m. UTC
This will be needed for the following commit, after which ff_get_buffer() will
stop setting frame->pts to AV_NOPTS_VALUE.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/binkaudio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 046bf93207..f28ecba760 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -296,9 +296,10 @@  static int binkaudio_receive_frame(AVCodecContext *avctx, AVFrame *frame)
 {
     BinkAudioContext *s = avctx->priv_data;
     GetBitContext *gb = &s->gb;
-    int ret;
+    int new_pkt, ret;
 
 again:
+    new_pkt = !s->pkt->data;
     if (!s->pkt->data) {
         ret = ff_decode_get_packet(avctx, s->pkt);
         if (ret < 0) {
@@ -325,6 +326,8 @@  again:
         frame->nb_samples = s->frame_len;
         if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
             return ret;
+        if (!new_pkt)
+            frame->pts = AV_NOPTS_VALUE;
     }
 
     if (decode_block(s, (float **)frame->extended_data,