From: "Tomas Härdin" <git@haerdin.se> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH 4/6] Un-mark IMA APC as intra-only Date: Tue, 26 Dec 2023 16:53:07 +0100 Message-ID: <dd86aaef3430d4c5332eda40f488d31339623c7c.camel@haerdin.se> (raw) In-Reply-To: <e8ff0c6cfe26a6559a3e1d987bde70072b7ddc4d.camel@haerdin.se> [-- Attachment #1: Type: text/plain, Size: 1 bytes --] [-- Attachment #2: 0004-Un-mark-IMA-APC-as-intra-only.patch --] [-- Type: text/x-patch, Size: 1615 bytes --] From dd84044af61931988e43bd58c202fe4e7ca7069a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <git@haerdin.se> Date: Tue, 26 Dec 2023 16:30:35 +0100 Subject: [PATCH 4/6] Un-mark IMA APC as intra-only Packets must be decoded in order. There is no way to seek and get a bitexact decode. --- libavcodec/codec_desc.c | 2 +- libavformat/apc.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 432a9c9ea6..899c082c83 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -2431,7 +2431,7 @@ static const AVCodecDescriptor codec_descriptors[] = { .type = AVMEDIA_TYPE_AUDIO, .name = "adpcm_ima_apc", .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA CRYO APC"), - .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + .props = AV_CODEC_PROP_LOSSY, }, { .id = AV_CODEC_ID_ADPCM_VIMA, diff --git a/libavformat/apc.c b/libavformat/apc.c index 7765c53088..d1891954a8 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -75,8 +75,13 @@ static int apc_read_header(AVFormatContext *s) static int apc_read_packet(AVFormatContext *s, AVPacket *pkt) { + int first = avio_tell(s->pb) == 32; if (av_get_packet(s->pb, pkt, MAX_READ_SIZE) <= 0) return AVERROR(EIO); + // each IMA APC packet depends on the one before for bitexact decode + // extradata is used to initialize the decoder + if (first) + pkt->flags |= AV_PKT_FLAG_KEY; pkt->stream_index = 0; return 0; } -- 2.39.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".
next prev parent reply other threads:[~2023-12-26 15:53 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-26 15:51 [FFmpeg-devel] [PATCH 1/6] doc/general_contents.texi: Add missing ADPCM IMA APC entry Tomas Härdin 2023-12-26 15:52 ` [FFmpeg-devel] [PATCH 2/6] apc: Read duration from file Tomas Härdin 2023-12-26 15:52 ` [FFmpeg-devel] [PATCH 3/6] Add CRYO APC muxer Tomas Härdin 2023-12-26 22:30 ` Michael Niedermayer 2023-12-28 10:31 ` Tomas Härdin 2023-12-29 17:33 ` Michael Niedermayer 2023-12-30 17:01 ` Tomas Härdin 2023-12-31 21:36 ` Michael Niedermayer 2023-12-28 17:23 ` Tomas Härdin 2023-12-28 17:29 ` Tomas Härdin 2023-12-26 15:53 ` Tomas Härdin [this message] 2023-12-26 15:53 ` [FFmpeg-devel] [PATCH 5/6] Add ADPCM IMA CRYO APC encoder Tomas Härdin 2023-12-26 15:53 ` [FFmpeg-devel] [PATCH 6/6] Add myself as APC maintainer Tomas Härdin
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=dd86aaef3430d4c5332eda40f488d31339623c7c.camel@haerdin.se \ --to=git@haerdin.se \ --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