summaryrefslogtreecommitdiff
path: root/libavformat/raw.c
diff options
context:
space:
mode:
authorBenjamin Larsson <banan@ludd.ltu.se>2006-05-09 12:34:35 +0000
committerBenjamin Larsson <banan@ludd.ltu.se>2006-05-09 12:34:35 +0000
commit89ca8c497fdf585c6f0d72f9a39f23dc84f0630e (patch)
tree3c2000987d9c958f2c017b3c3524ee3f25d79ba3 /libavformat/raw.c
parentd4277a7d5189bbedfc70968ce90b60ea60f23835 (diff)
Add support for raw flac decoding based on the .flac suffix of input files.
Originally committed as revision 5352 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/raw.c')
-rw-r--r--libavformat/raw.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c
index d1e01f2500..057e060341 100644
--- a/libavformat/raw.c
+++ b/libavformat/raw.c
@@ -236,6 +236,22 @@ static int shorten_read_header(AVFormatContext *s,
return 0;
}
+/* flac read */
+static int flac_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_FLAC;
+ st->need_parsing = 1;
+ /* the parameters will be extracted from the compressed bitstream */
+ return 0;
+}
+
/* dts read */
static int dts_read_header(AVFormatContext *s,
AVFormatParameters *ap)
@@ -370,6 +386,17 @@ AVInputFormat shorten_iformat = {
.extensions = "shn",
};
+AVInputFormat flac_iformat = {
+ "flac",
+ "raw flac",
+ 0,
+ NULL,
+ flac_read_header,
+ raw_read_partial_packet,
+ raw_read_close,
+ .extensions = "flac",
+};
+
AVInputFormat ac3_iformat = {
"ac3",
"raw ac3",
@@ -764,6 +791,7 @@ int raw_init(void)
{
av_register_input_format(&shorten_iformat);
+ av_register_input_format(&flac_iformat);
av_register_input_format(&ac3_iformat);
av_register_output_format(&ac3_oformat);