summaryrefslogtreecommitdiff
path: root/libavformat/xa.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-03-20 12:13:15 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-03-20 14:12:54 -0400
commit777365fe8602d4b92e2664647d0e5fe2418d4bf6 (patch)
tree3893e316ff88246a39fceab2b86c7feb38398717 /libavformat/xa.c
parenta54bc52265b9b42e0735507f3b28cfb49a9d3c62 (diff)
xa: set correct bit rate
Also fixes stream duration calculation.
Diffstat (limited to 'libavformat/xa.c')
-rw-r--r--libavformat/xa.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/xa.c b/libavformat/xa.c
index 4cec2dae88..09ef17ff35 100644
--- a/libavformat/xa.c
+++ b/libavformat/xa.c
@@ -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 */
+ st->codec->bit_rate = av_clip(15LL * st->codec->channels * 8 *
+ st->codec->sample_rate / 28, 0, INT_MAX);
+
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
st->start_time = 0;