1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

au: set block_align and use it in au_read_packet()

This commit is contained in:
Justin Ruggles 2012-12-23 13:20:59 -05:00
parent 9a7b56883d
commit bd4cdef5a8

View File

@ -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;