changeset 938:cb34086a75f7 libavformat

voc: set bits_per_sample correctly (fix mplayer playback)
author aurel
date Thu, 09 Feb 2006 23:53:07 +0000
parents a887adfe9dc5
children 61959072be81
files voc.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/voc.c	Thu Feb 09 22:52:23 2006 +0000
+++ b/voc.c	Thu Feb 09 23:53:07 2006 +0000
@@ -90,6 +90,18 @@
     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 @@
                 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;