diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-02-26 03:36:04 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-02-26 03:36:04 +0000 |
commit | 85ad569574a1a7d81c48b10e394b1ce7aaca5b7b (patch) | |
tree | 55f895388471ed46c2ce9997101ec6edb939f303 /libavformat | |
parent | 21754ce65c78acf8134edbe1f60ce503c0345977 (diff) | |
download | ffmpeg-85ad569574a1a7d81c48b10e394b1ce7aaca5b7b.tar.gz |
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
Originally committed as revision 3984 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/raw.c | 29 | ||||
-rw-r--r-- | libavformat/utils.c | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c index 075db7918b..a0bbbce4f3 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -188,6 +188,21 @@ static int ac3_read_header(AVFormatContext *s, return 0; } +static int shorten_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_SHORTEN; + 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) @@ -295,6 +310,17 @@ static int h261_probe(AVProbeData *p) return 0; } +AVInputFormat shorten_iformat = { + "shn", + "raw shn", + 0, + NULL, + shorten_read_header, + raw_read_partial_packet, + raw_read_close, + .extensions = "shn", +}; + AVInputFormat ac3_iformat = { "ac3", "raw ac3", @@ -672,6 +698,9 @@ AVOutputFormat null_oformat = { int raw_init(void) { + + av_register_input_format(&shorten_iformat); + av_register_input_format(&ac3_iformat); av_register_output_format(&ac3_oformat); diff --git a/libavformat/utils.c b/libavformat/utils.c index 0e008da974..fc49a6d8b7 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1845,6 +1845,7 @@ int av_find_stream_info(AVFormatContext *ic) st->codec.codec_id == CODEC_ID_PGMYUV || st->codec.codec_id == CODEC_ID_PBM || st->codec.codec_id == CODEC_ID_PPM || + st->codec.codec_id == CODEC_ID_SHORTEN || (st->codec.codec_id == CODEC_ID_MPEG4 && !st->need_parsing))) try_decode_frame(st, pkt->data, pkt->size); |