diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-13 12:06:09 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-14 00:05:36 +0200 |
commit | eb8b325202ac9e03a2fcf666f0b346226acf90f2 (patch) | |
tree | 5909897eb010bcb1c17b039151c28ec46dd6dfd7 | |
parent | ca1dfea12771b585846fb86aa08c3d7f066a3cc4 (diff) | |
download | ffmpeg-eb8b325202ac9e03a2fcf666f0b346226acf90f2.tar.gz |
Support streaming .au files.
FFmpeg writes data_size as AU_UNKNOWN_SIZE, make demuxer not
fail when data_size is set to this value.
Should fix trac issue #394.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
-rw-r--r-- | libavformat/au.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/au.c b/libavformat/au.c index 870f46f65d..477bcdb67f 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -134,7 +134,7 @@ static int au_read_header(AVFormatContext *s, size = avio_rb32(pb); /* header size */ data_size = avio_rb32(pb); /* data size in bytes */ - if (data_size < 0) { + if (data_size < 0 && data_size != AU_UNKNOWN_SIZE) { av_log(s, AV_LOG_ERROR, "Invalid negative data size '%d' found\n", data_size); return AVERROR_INVALIDDATA; } @@ -164,6 +164,7 @@ static int au_read_header(AVFormatContext *s, st->codec->codec_id = codec; st->codec->channels = channels; st->codec->sample_rate = rate; + if (data_size != AU_UNKNOWN_SIZE) st->duration = (((int64_t)data_size)<<3) / (st->codec->channels * bps); av_set_pts_info(st, 64, 1, rate); return 0; |