[FFmpeg-cvslog] xa: set correct bit rate

Justin Ruggles git at videolan.org
Wed Mar 21 02:35:03 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Mar 20 12:13:15 2012 -0400| [777365fe8602d4b92e2664647d0e5fe2418d4bf6] | committer: Justin Ruggles

xa: set correct bit rate

Also fixes stream duration calculation.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=777365fe8602d4b92e2664647d0e5fe2418d4bf6
---

 libavformat/xa.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/xa.c b/libavformat/xa.c
index 4cec2da..09ef17f 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;
 



More information about the ffmpeg-cvslog mailing list