Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/amr*bdec: return only number of consumed bytes
@ 2022-08-31 16:40 Paul B Mahol
  2022-09-02  7:27 ` Anton Khirnov
  0 siblings, 1 reply; 7+ messages in thread
From: Paul B Mahol @ 2022-08-31 16:40 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 16 bytes --]

Patch attached.

[-- Attachment #2: 0001-avcodec-amr-bdec-return-only-number-of-consumed-byte.patch --]
[-- Type: text/x-patch, Size: 1096 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-02  8:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 16:40 [FFmpeg-devel] [PATCH] avcodec/amr*bdec: return only number of consumed bytes Paul B Mahol
2022-09-02  7:27 ` Anton Khirnov
2022-09-02  8:00   ` Paul B Mahol
2022-09-02  8:03     ` Anton Khirnov
2022-09-02  8:14       ` Paul B Mahol
2022-09-02  8:15         ` Anton Khirnov
2022-09-02  8:23           ` Paul B Mahol

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git