diff mbox series

[FFmpeg-devel] avcodec/amr*bdec: return only number of consumed bytes

Message ID CAPYw7P6iWob0NzF6PqdwwzCzNy43E+6op4T0Z0fFXGwLHk9pYw@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] avcodec/amr*bdec: return only number of consumed bytes | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Paul B Mahol Aug. 31, 2022, 4:40 p.m. UTC
Patch attached.

Comments

Anton Khirnov Sept. 2, 2022, 7:27 a.m. UTC | #1
Quoting Paul B Mahol (2022-08-31 18:40:32)
> Patch attached.
> 
> From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Wed, 31 Aug 2022 18:36:04 +0200
> Subject: [PATCH] avcodec/amr*bdec: return only number of consumed bytes

Could mention where does one get a sample where this changes anything.
Paul B Mahol Sept. 2, 2022, 8 a.m. UTC | #2
On Fri, Sep 2, 2022 at 9:27 AM Anton Khirnov <anton@khirnov.net> wrote:

> Quoting Paul B Mahol (2022-08-31 18:40:32)
> > Patch attached.
> >
> > From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00 2001
> > From: Paul B Mahol <onemda@gmail.com>
> > Date: Wed, 31 Aug 2022 18:36:04 +0200
> > Subject: [PATCH] avcodec/amr*bdec: return only number of consumed bytes
>
> Could mention where does one get a sample where this changes anything.
>

If fixes samples that give big chunk of data instead of properly splitting
input into small
packets.


>
> --
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
Anton Khirnov Sept. 2, 2022, 8:03 a.m. UTC | #3
Quoting Paul B Mahol (2022-09-02 10:00:22)
> On Fri, Sep 2, 2022 at 9:27 AM Anton Khirnov <anton@khirnov.net> wrote:
> 
> > Quoting Paul B Mahol (2022-08-31 18:40:32)
> > > Patch attached.
> > >
> > > From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00 2001
> > > From: Paul B Mahol <onemda@gmail.com>
> > > Date: Wed, 31 Aug 2022 18:36:04 +0200
> > > Subject: [PATCH] avcodec/amr*bdec: return only number of consumed bytes
> >
> > Could mention where does one get a sample where this changes anything.
> >
> 
> If fixes samples that give big chunk of data instead of properly
> splitting input into small packets.

And where can I get such a sample?
It will be useful to someone looking at this commit in 10 years.
Paul B Mahol Sept. 2, 2022, 8:14 a.m. UTC | #4
On Fri, Sep 2, 2022 at 10:04 AM Anton Khirnov <anton@khirnov.net> wrote:

> Quoting Paul B Mahol (2022-09-02 10:00:22)
> > On Fri, Sep 2, 2022 at 9:27 AM Anton Khirnov <anton@khirnov.net> wrote:
> >
> > > Quoting Paul B Mahol (2022-08-31 18:40:32)
> > > > Patch attached.
> > > >
> > > > From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00
> 2001
> > > > From: Paul B Mahol <onemda@gmail.com>
> > > > Date: Wed, 31 Aug 2022 18:36:04 +0200
> > > > Subject: [PATCH] avcodec/amr*bdec: return only number of consumed
> bytes
> > >
> > > Could mention where does one get a sample where this changes anything.
> > >
> >
> > If fixes samples that give big chunk of data instead of properly
> > splitting input into small packets.
>
> And where can I get such a sample?
> It will be useful to someone looking at this commit in 10 years.
>

On trac. But this was regression anyway.


> --
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
Anton Khirnov Sept. 2, 2022, 8:15 a.m. UTC | #5
Quoting Paul B Mahol (2022-09-02 10:14:49)
> On Fri, Sep 2, 2022 at 10:04 AM Anton Khirnov <anton@khirnov.net> wrote:
> 
> > Quoting Paul B Mahol (2022-09-02 10:00:22)
> > > On Fri, Sep 2, 2022 at 9:27 AM Anton Khirnov <anton@khirnov.net> wrote:
> > >
> > > > Quoting Paul B Mahol (2022-08-31 18:40:32)
> > > > > Patch attached.
> > > > >
> > > > > From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00
> > 2001
> > > > > From: Paul B Mahol <onemda@gmail.com>
> > > > > Date: Wed, 31 Aug 2022 18:36:04 +0200
> > > > > Subject: [PATCH] avcodec/amr*bdec: return only number of consumed
> > bytes
> > > >
> > > > Could mention where does one get a sample where this changes anything.
> > > >
> > >
> > > If fixes samples that give big chunk of data instead of properly
> > > splitting input into small packets.
> >
> > And where can I get such a sample?
> > It will be useful to someone looking at this commit in 10 years.
> >
> 
> On trac. But this was regression anyway.

Mention the ticket number in the commit message then.
Paul B Mahol Sept. 2, 2022, 8:23 a.m. UTC | #6
On Fri, Sep 2, 2022 at 10:15 AM Anton Khirnov <anton@khirnov.net> wrote:

> Quoting Paul B Mahol (2022-09-02 10:14:49)
> > On Fri, Sep 2, 2022 at 10:04 AM Anton Khirnov <anton@khirnov.net> wrote:
> >
> > > Quoting Paul B Mahol (2022-09-02 10:00:22)
> > > > On Fri, Sep 2, 2022 at 9:27 AM Anton Khirnov <anton@khirnov.net>
> wrote:
> > > >
> > > > > Quoting Paul B Mahol (2022-08-31 18:40:32)
> > > > > > Patch attached.
> > > > > >
> > > > > > From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00
> > > 2001
> > > > > > From: Paul B Mahol <onemda@gmail.com>
> > > > > > Date: Wed, 31 Aug 2022 18:36:04 +0200
> > > > > > Subject: [PATCH] avcodec/amr*bdec: return only number of consumed
> > > bytes
> > > > >
> > > > > Could mention where does one get a sample where this changes
> anything.
> > > > >
> > > >
> > > > If fixes samples that give big chunk of data instead of properly
> > > > splitting input into small packets.
> > >
> > > And where can I get such a sample?
> > > It will be useful to someone looking at this commit in 10 years.
> > >
> >
> > On trac. But this was regression anyway.
>
> Mention the ticket number in the commit message then.
>


Too late.


>
> --
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Wed, 31 Aug 2022 18:36:04 +0200
Subject: [PATCH] avcodec/amr*bdec: return only number of consumed bytes

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/amrnbdec.c | 2 +-
 libavcodec/amrwbdec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 8c1073916e..0a2e697e6d 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -1092,7 +1092,7 @@  static int amrnb_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     *got_frame_ptr = 1;
 
-    return avpkt->size;
+    return buf - avpkt->data;
 }
 
 
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 6a5b79f52c..4f5e454b52 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -1289,7 +1289,7 @@  static int amrwb_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     *got_frame_ptr = 1;
 
-    return avpkt->size;
+    return buf - avpkt->data;
 }
 
 const FFCodec ff_amrwb_decoder = {
-- 
2.37.2