From: Lynne <dev@lynne.ee> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [RFC PATCH 2/3] decode: allow decoders to override skip_samples Date: Tue, 12 Sep 2023 08:11:27 +0200 (CEST) Message-ID: <Ne701AP--3-9@lynne.ee> (raw) In-Reply-To: <Ne7-l4q--3-9@lynne.ee-Ne7-pA6----9> [-- Attachment #1: Type: text/plain, Size: 55 bytes --] Very hacky. There must be a better way of doing this. [-- Attachment #2: 0002-decode-allow-decoders-to-override-skip_samples.patch --] [-- Type: text/x-diff, Size: 1533 bytes --] From 843809ac072bbaf9ae0d3d3946723f1fcfb07923 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> Date: Tue, 12 Sep 2023 08:00:02 +0200 Subject: [PATCH 2/3] decode: allow decoders to override skip_samples --- libavcodec/decode.c | 5 ++++- libavcodec/internal.h | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 169ee79acd..9e8a4532f2 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -312,7 +312,10 @@ static int discard_samples(AVCodecContext *avctx, AVFrame *frame, int64_t *disca side = av_frame_get_side_data(frame, AV_FRAME_DATA_SKIP_SAMPLES); if (side && side->size >= 10) { - avci->skip_samples = AV_RL32(side->data); + if (avci->skip_samples_add) + avci->skip_samples += AV_RL32(side->data); + else + avci->skip_samples = AV_RL32(side->data); avci->skip_samples = FFMAX(0, avci->skip_samples); discard_padding = AV_RL32(side->data + 4); av_log(avctx, AV_LOG_DEBUG, "skip %d / discard %d samples due to side data\n", diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 83e0bc3fb2..8f59a117ba 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -118,6 +118,11 @@ typedef struct AVCodecInternal { */ int skip_samples; + /** + * In case there's side data, add it to skip_samples, instead of overriding it. + */ + int skip_samples_add; + /** * hwaccel-specific private data */ -- 2.40.1 [-- 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".
next prev parent reply other threads:[~2023-09-12 6:11 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-09-12 6:10 [FFmpeg-devel] [RFC PATCH 1/3] aacdec: always skip the first 2048 samples if there's no side data Lynne [not found] ` <Ne7-l4q--3-9@lynne.ee-Ne7-pA6----9> 2023-09-12 6:11 ` Lynne [this message] 2023-09-12 6:14 ` [FFmpeg-devel] [RFC PATCH 3/3] aacdec: allow to skip sbr start-up delay Lynne [not found] ` <Ne70gnX--3-9@lynne.ee-Ne70juu----9> 2023-09-12 6:15 ` Lynne 2023-09-12 7:10 ` [FFmpeg-devel] [RFC PATCH 1/3] aacdec: always skip the first 2048 samples if there's no side data Andreas Rheinhardt 2023-09-12 16:25 ` Lynne 2023-09-12 21:24 ` Thierry Foucu 2023-10-03 4:09 ` Lynne
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=Ne701AP--3-9@lynne.ee \ --to=dev@lynne.ee \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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