# HG changeset patch # User aurel # Date 1193939405 0 # Node ID bb2ba011f1e172a814803f84090f494ca8504345 # Parent 997fb1ac4783e8029ad32b441f29261c3a374295 remove useless initialization to 0 of adx context diff -r 997fb1ac4783 -r bb2ba011f1e1 mpeg.c --- a/mpeg.c Thu Nov 01 09:02:29 2007 +0000 +++ b/mpeg.c Thu Nov 01 17:50:05 2007 +0000 @@ -85,15 +85,25 @@ typedef struct MpegDemuxContext { int32_t header_state; unsigned char psm_es_type[256]; + int sofdec; } MpegDemuxContext; static int mpegps_read_header(AVFormatContext *s, AVFormatParameters *ap) { MpegDemuxContext *m = s->priv_data; + uint8_t buffer[8192]; + char *p; + m->header_state = 0xff; s->ctx_flags |= AVFMTCTX_NOHEADER; + get_buffer(&s->pb, buffer, sizeof(buffer)); + if ((p=memchr(buffer, 'S', sizeof(buffer)))) + if (!memcmp(p, "Sofdec", 6)) + m->sofdec = 1; + url_fseek(&s->pb, -sizeof(buffer), SEEK_CUR); + /* no need to do more */ return 0; } @@ -427,7 +437,7 @@ type = CODEC_TYPE_VIDEO; } else if (startcode >= 0x1c0 && startcode <= 0x1df) { type = CODEC_TYPE_AUDIO; - codec_id = CODEC_ID_MP2; + codec_id = m->sofdec ? CODEC_ID_ADPCM_ADX : CODEC_ID_MP2; } else if (startcode >= 0x80 && startcode <= 0x87) { type = CODEC_TYPE_AUDIO; codec_id = CODEC_ID_AC3;