diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2007-02-08 23:41:08 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2007-02-08 23:41:08 +0000 |
commit | 7156aeb98a9e1171090d705c102fbcb227ac7311 (patch) | |
tree | c82dbe76a97b77a3d01cde4f7d9c6fcd8f62a656 /libavformat/raw.c | |
parent | 74cec57d8e892ff8ac6d8e570b634ae8d7e94a9f (diff) | |
download | ffmpeg-streaming-7156aeb98a9e1171090d705c102fbcb227ac7311.zip ffmpeg-streaming-7156aeb98a9e1171090d705c102fbcb227ac7311.tar.gz |
add read_probe function to raw ac3 demuxer
Originally committed as revision 7887 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/raw.c')
-rw-r--r-- | libavformat/raw.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c index 7e84ff0..56f47ad 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -406,6 +406,22 @@ static int h261_probe(AVProbeData *p) return 0; } +static int ac3_probe(AVProbeData *p) +{ + int score=0; + + if(p->buf_size < 6) + return 0; + + if((p->buf[0] == 0x0B) && (p->buf[1] == 0x77) && // sync word + ((p->buf[4] >> 6) != 3) && // fscod + ((p->buf[5] >> 3) <= 16)) { // bsid + score = AVPROBE_SCORE_MAX / 2 + 10; + } + + return score; +} + AVInputFormat shorten_demuxer = { "shn", "raw shorten", @@ -450,7 +466,7 @@ AVInputFormat ac3_demuxer = { "ac3", "raw ac3", 0, - NULL, + ac3_probe, ac3_read_header, raw_read_partial_packet, raw_read_close, |