[FFmpeg-devel] [PATCH]Support ac-3 in sfd

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Nov 30 02:14:47 CET 2013


Hi!

Attached patch fixes ticket #3184 for me.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 1ea58d5..5d37167 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -521,7 +521,17 @@ static int mpegps_read_packet(AVFormatContext *s,
         codec_id = AV_CODEC_ID_DVD_NAV;
     } else if (startcode >= 0x1c0 && startcode <= 0x1df) {
         type = AVMEDIA_TYPE_AUDIO;
-        codec_id = m->sofdec > 0 ? AV_CODEC_ID_ADPCM_ADX : AV_CODEC_ID_MP2;
+        if (m->sofdec) {
+            switch (startcode) {
+            case 0x1c1:
+                codec_id = AV_CODEC_ID_AC3;
+                break;
+            default:
+                codec_id = AV_CODEC_ID_ADPCM_ADX;
+            }
+        } else {
+            codec_id = AV_CODEC_ID_MP2;
+        }
     } else if (startcode >= 0x80 && startcode <= 0x87) {
         type = AVMEDIA_TYPE_AUDIO;
         codec_id = AV_CODEC_ID_AC3;


More information about the ffmpeg-devel mailing list