diff mbox series

[FFmpeg-devel,03/15] libaformat/mp3dec: Register the MIME type "audio/mpeg" to the mp3 decoder.

Message ID 57f814d123cd0cf25d7ef3b5ba22018397aea0c1.camel@haerdin.se
State New
Headers show
Series Spotify patchset | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch
yinshiyou/configure_loongarch64 warning Failed to apply patch

Commit Message

Tomas Härdin Oct. 29, 2024, 2:45 p.m. UTC
Reasonable enough

Spotify comments
----------------
mp3 input misdetected as mpeg ps and fails to decode

Possible other solutions:
    • Improve mp3 probe code to give higher score
    • Improve mpeg ps probe code to give lower score
    • Make it possible at runtime to enable/disable format/codecs. That
way we could disable some known problematic formats and codecs that we
don’t accept as input anyways.

/Tomas
diff mbox series

Patch

From 24d70d825c9ee3b5894de0b8dde6468a38a11059 Mon Sep 17 00:00:00 2001
From: Richard Mitic <richardmitic@spotify.com>
Date: Tue, 4 May 2021 14:50:42 +0200
Subject: [PATCH 03/15] libaformat/mp3dec: Register the MIME type "audio/mpeg"
 to the mp3 decoder.

Some mp3 files look surprisingly like mpeg PS streams. In order for us
to hint to ffmpeg that the file really is mp3, we can deliver it with a
mime type. The mp3 probe therefore needs to have a mime type registered,
(which is previously did not).
---
 libavformat/mp3dec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 0029ba63aa..dac91205d9 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -613,6 +613,7 @@  const FFInputFormat ff_mp3_demuxer = {
     .p.flags        = AVFMT_GENERIC_INDEX,
     .p.extensions   = "mp2,mp3,m2a,mpa", /* XXX: use probe */
     .p.priv_class   = &demuxer_class,
+    .p.mime_type    = "audio/mpeg",
     .read_probe     = mp3_read_probe,
     .read_header    = mp3_read_header,
     .read_packet    = mp3_read_packet,
-- 
2.39.2