diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavformat/xa.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavformat/xa.c')
| -rw-r--r-- | ffmpeg/libavformat/xa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ffmpeg/libavformat/xa.c b/ffmpeg/libavformat/xa.c index e3d36e6..43661de 100644 --- a/ffmpeg/libavformat/xa.c +++ b/ffmpeg/libavformat/xa.c @@ -59,7 +59,7 @@ static int xa_probe(AVProbeData *p) if (!channels || channels > 8 || !srate || srate > 192000 || bits_per_sample < 4 || bits_per_sample > 32) return 0; - return AVPROBE_SCORE_MAX/2; + return AVPROBE_SCORE_EXTENSION; } static int xa_read_header(AVFormatContext *s) @@ -84,6 +84,9 @@ static int xa_read_header(AVFormatContext *s) avio_skip(pb, 2); /* Skip block align */ avio_skip(pb, 2); /* Skip bits-per-sample */ + if (!st->codec->channels || !st->codec->sample_rate) + return AVERROR_INVALIDDATA; + st->codec->bit_rate = av_clip(15LL * st->codec->channels * 8 * st->codec->sample_rate / 28, 0, INT_MAX); |
