aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/au.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-12-23 13:20:59 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2013-01-09 11:52:56 -0500
commitbd4cdef5a8ca0389f8266a172988bd74aaaf4c77 (patch)
tree82de7429c67296ea6db2f45b893649846048526b /libavformat/au.c
parent9a7b56883d1333cdfcdf0fa7584a333841b86114 (diff)
downloadffmpeg-bd4cdef5a8ca0389f8266a172988bd74aaaf4c77.tar.gz
au: set block_align and use it in au_read_packet()
Diffstat (limited to 'libavformat/au.c')
-rw-r--r--libavformat/au.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/au.c b/libavformat/au.c
index f1038da64b..fcc599ba96 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -112,6 +112,7 @@ static int au_read_header(AVFormatContext *s)
st->codec->channels = channels;
st->codec->sample_rate = rate;
st->codec->bit_rate = channels * rate * bps;
+ st->codec->block_align = channels * bps >> 3;
avpriv_set_pts_info(st, 64, 1, rate);
return 0;
}
@@ -123,9 +124,8 @@ static int au_read_packet(AVFormatContext *s,
{
int ret;
- ret= av_get_packet(s->pb, pkt, BLOCK_SIZE *
- s->streams[0]->codec->channels *
- av_get_bits_per_sample(s->streams[0]->codec->codec_id) >> 3);
+ ret = av_get_packet(s->pb, pkt, BLOCK_SIZE *
+ s->streams[0]->codec->block_align);
if (ret < 0)
return ret;
pkt->stream_index = 0;