summaryrefslogtreecommitdiff
path: root/libavformat/voc.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2006-02-09 23:53:07 +0000
committerAurelien Jacobs <aurel@gnuage.org>2006-02-09 23:53:07 +0000
commitb96532e9702e46572e5acad2deba3a7cd802630e (patch)
treeca5f4d4adfdd45b88207bb5166b9e701ee4928d1 /libavformat/voc.c
parentea395e8c6c6eabc5ddbbe79ce004f51cecc0065b (diff)
voc: set bits_per_sample correctly (fix mplayer playback)
Originally committed as revision 4968 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/voc.c')
-rw-r--r--libavformat/voc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/voc.c b/libavformat/voc.c
index 7c723a4011..712f71a725 100644
--- a/libavformat/voc.c
+++ b/libavformat/voc.c
@@ -90,6 +90,18 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap)
return 0;
}
+static int voc_get_bps(int codec_id)
+{
+ switch (codec_id) {
+ case CODEC_ID_PCM_S16LE:
+ return 16;
+ case CODEC_ID_ADPCM_CT:
+ return 4;
+ default:
+ return 8;
+ }
+}
+
int
voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
{
@@ -115,6 +127,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
dec->sample_rate = sample_rate;
dec->channels = channels;
dec->codec_id = codec_get_id(voc_codec_tags, get_byte(pb));
+ dec->bits_per_sample = voc_get_bps(dec->codec_id);
voc->remaining_size -= 2;
max_size -= 2;
channels = 1;