Browse Source

raw ac3 auto detects parameters

Originally committed as revision 1566 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Fabrice Bellard 23 years ago
parent
commit
cd66005dda
1 changed files with 17 additions and 2 deletions
  1. +17
    -2
      libavformat/raw.c

+ 17
- 2
libavformat/raw.c View File

@@ -122,6 +122,22 @@ static int mp3_read_header(AVFormatContext *s,
return 0; 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 */ /* mpeg1/h263 input */
static int video_read_header(AVFormatContext *s, static int video_read_header(AVFormatContext *s,
AVFormatParameters *ap) AVFormatParameters *ap)
@@ -207,11 +223,10 @@ AVInputFormat ac3_iformat = {
"raw ac3", "raw ac3",
0, 0,
NULL, NULL,
raw_read_header,
ac3_read_header,
raw_read_packet, raw_read_packet,
raw_read_close, raw_read_close,
.extensions = "ac3", .extensions = "ac3",
.value = CODEC_ID_AC3,
}; };


AVOutputFormat ac3_oformat = { AVOutputFormat ac3_oformat = {


Loading…
Cancel
Save