Commit 5b475562 authored by aurel's avatar aurel

simplify the voc demuxer using av_get_bits_per_sample()


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5663 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b0d10fed
...@@ -1306,6 +1306,11 @@ char av_get_pict_type_char(int pict_type){ ...@@ -1306,6 +1306,11 @@ char av_get_pict_type_char(int pict_type){
int av_get_bits_per_sample(enum CodecID codec_id){ int av_get_bits_per_sample(enum CodecID codec_id){
switch(codec_id){ switch(codec_id){
case CODEC_ID_ADPCM_CT:
case CODEC_ID_ADPCM_SBPRO_2:
case CODEC_ID_ADPCM_SBPRO_3:
case CODEC_ID_ADPCM_SBPRO_4:
return 0;
case CODEC_ID_PCM_ALAW: case CODEC_ID_PCM_ALAW:
case CODEC_ID_PCM_MULAW: case CODEC_ID_PCM_MULAW:
case CODEC_ID_PCM_S8: case CODEC_ID_PCM_S8:
......
...@@ -93,18 +93,6 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -93,18 +93,6 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap)
return 0; 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 int
voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
{ {
...@@ -130,7 +118,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) ...@@ -130,7 +118,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
dec->sample_rate = sample_rate; dec->sample_rate = sample_rate;
dec->channels = channels; dec->channels = channels;
dec->codec_id = codec_get_id(voc_codec_tags, get_byte(pb)); dec->codec_id = codec_get_id(voc_codec_tags, get_byte(pb));
dec->bits_per_sample = voc_get_bps(dec->codec_id); dec->bits_per_sample = av_get_bits_per_sample(dec->codec_id);
voc->remaining_size -= 2; voc->remaining_size -= 2;
max_size -= 2; max_size -= 2;
channels = 1; channels = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment