[FFmpeg-devel] [PATCH]Support ac-3 in sfd
Carl Eugen Hoyos
cehoyos at ag.or.at
Sun Dec 1 05:15:33 CET 2013
On Sunday 01 December 2013 03:14:17 am Michael Niedermayer wrote:
> On Sat, Nov 30, 2013 at 02:14:47AM +0100, Carl Eugen Hoyos wrote:
> > Hi!
> >
> > Attached patch fixes ticket #3184 for me.
> > } 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;
> > + }
>
> i doubt a bit that this is the correct way to identify the codec
You are right, it breaks at least one of our samples.
New patch attached.
Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 1ea58d5..90434a1 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -521,7 +521,13 @@ 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 > 0) {
+ codec_id = AV_CODEC_ID_ADPCM_ADX;
+ // Auto-detect AC-3
+ request_probe = 50;
+ } 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