diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-04-12 00:25:37 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-04-12 00:25:37 +0000 |
commit | a3d23e15fbcdfaf4e36c91c5018d87da712282ad (patch) | |
tree | 32abdda0a448c20f1c1cf9e50a81b7f2b47f1e45 /libavformat/raw.c | |
parent | d2e63e8b0553d400f81285d354f85e778d1cf888 (diff) | |
download | ffmpeg-a3d23e15fbcdfaf4e36c91c5018d87da712282ad.tar.gz |
fix 6 channels raw pcm demuxing, raw pcm now demux a fixed number of samples
Originally committed as revision 18453 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/raw.c')
-rw-r--r-- | libavformat/raw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c index 78662ae6e8..0b6f87041d 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -84,6 +84,9 @@ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->sample_rate = ap->sample_rate; if(ap->channels) st->codec->channels = ap->channels; else st->codec->channels = 1; + st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id); + assert(st->codec->bits_per_coded_sample > 0); + 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); break; case CODEC_TYPE_VIDEO: @@ -104,13 +107,14 @@ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) } #define RAW_PACKET_SIZE 1024 +#define RAW_SAMPLES 1024 static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret, size, bps; // AVStream *st = s->streams[0]; - size= RAW_PACKET_SIZE; + size= RAW_SAMPLES*s->streams[0]->codec->block_align; ret= av_get_packet(s->pb, pkt, size); |