aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-02-09 18:07:16 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-02-09 18:07:16 +0000
commitcd66005ddaebba2d6cb3b4eae75f70ae2446b204 (patch)
treed50a6857ebcf0f462080df0d52c0aa0e63fc0a92
parent9899efb41a5a132a20a3c46ac97418a66e1a119c (diff)
downloadffmpeg-cd66005ddaebba2d6cb3b4eae75f70ae2446b204.tar.gz
raw ac3 auto detects parameters
Originally committed as revision 1566 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/raw.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c
index e5cae2ff67..4fb25b7e03 100644
--- a/libavformat/raw.c
+++ b/libavformat/raw.c
@@ -122,6 +122,22 @@ static int mp3_read_header(AVFormatContext *s,
return 0;
}
+/* ac3 read */
+static int ac3_read_header(AVFormatContext *s,
+ AVFormatParameters *ap)
+{
+ AVStream *st;
+
+ st = av_new_stream(s, 0);
+ if (!st)
+ return AVERROR_NOMEM;
+
+ st->codec.codec_type = CODEC_TYPE_AUDIO;
+ st->codec.codec_id = CODEC_ID_AC3;
+ /* the parameters will be extracted from the compressed bitstream */
+ return 0;
+}
+
/* mpeg1/h263 input */
static int video_read_header(AVFormatContext *s,
AVFormatParameters *ap)
@@ -207,11 +223,10 @@ AVInputFormat ac3_iformat = {
"raw ac3",
0,
NULL,
- raw_read_header,
+ ac3_read_header,
raw_read_packet,
raw_read_close,
.extensions = "ac3",
- .value = CODEC_ID_AC3,
};
AVOutputFormat ac3_oformat = {