Commit e5cdb82c authored by banan's avatar banan

Add support for raw flac decoding based on the .flac suffix of input files.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5352 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d3f1f17d
...@@ -236,6 +236,22 @@ static int shorten_read_header(AVFormatContext *s, ...@@ -236,6 +236,22 @@ static int shorten_read_header(AVFormatContext *s,
return 0; 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 */ /* dts read */
static int dts_read_header(AVFormatContext *s, static int dts_read_header(AVFormatContext *s,
AVFormatParameters *ap) AVFormatParameters *ap)
...@@ -370,6 +386,17 @@ AVInputFormat shorten_iformat = { ...@@ -370,6 +386,17 @@ AVInputFormat shorten_iformat = {
.extensions = "shn", .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 = { AVInputFormat ac3_iformat = {
"ac3", "ac3",
"raw ac3", "raw ac3",
...@@ -764,6 +791,7 @@ int raw_init(void) ...@@ -764,6 +791,7 @@ int raw_init(void)
{ {
av_register_input_format(&shorten_iformat); av_register_input_format(&shorten_iformat);
av_register_input_format(&flac_iformat);
av_register_input_format(&ac3_iformat); av_register_input_format(&ac3_iformat);
av_register_output_format(&ac3_oformat); av_register_output_format(&ac3_oformat);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment