diff options
author | Phil Rutschman <phil.rutschman@modsystems.com> | 2009-07-08 12:52:56 +0400 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2009-07-08 12:52:56 +0400 |
commit | 5a1e202b873c7e61d025f3a572ab0c8b48319984 (patch) | |
tree | 8188291c90bafc80f343716d5232bbbc313d90e1 | |
parent | 56c6cf287b9f1d25f4c91e00892c5ab3f8436d10 (diff) |
Add block_align to sox input.
Patch by Phil Rutschman: name.surname modsystems com
Originally committed as revision 19371 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/soxdec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c index 0a30b9cb48..f6389caec9 100644 --- a/libavformat/soxdec.c +++ b/libavformat/soxdec.c @@ -112,23 +112,26 @@ static int sox_read_header(AVFormatContext *s, st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels; + st->codec->block_align = st->codec->bits_per_coded_sample * + st->codec->channels / 8; av_set_pts_info(st, 64, 1, st->codec->sample_rate); return 0; } -#define MAX_SIZE 4096 +#define SOX_SAMPLES 1024 static int sox_read_packet(AVFormatContext *s, AVPacket *pkt) { - int ret; + int ret, size; if (url_feof(s->pb)) return AVERROR_EOF; - ret = av_get_packet(s->pb, pkt, MAX_SIZE); + size = SOX_SAMPLES*s->streams[0]->codec->block_align; + ret = av_get_packet(s->pb, pkt, size); if (ret < 0) return AVERROR(EIO); pkt->stream_index = 0; |