# HG changeset patch # User aurel # Date 1139529187 0 # Node ID cb34086a75f704b1f634043fb0a20e308d422308 # Parent a887adfe9dc5bb28ca472bd968ed0b87d132db7d voc: set bits_per_sample correctly (fix mplayer playback) diff -r a887adfe9dc5 -r cb34086a75f7 voc.c --- 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;