[SCM] libav/experimental: simplify the voc demuxer using av_get_bits_per_sample()
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 15:48:51 UTC 2013
The following commit has been merged in the experimental branch:
commit 5da714699d6e16f3a915fbe2cef9f5e9d8d77172
Author: Aurelien Jacobs <aurel at gnuage.org>
Date: Fri Jul 7 22:42:36 2006 +0000
simplify the voc demuxer using av_get_bits_per_sample()
Originally committed as revision 5663 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b343ba0..574238e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1306,6 +1306,11 @@ char av_get_pict_type_char(int pict_type){
int av_get_bits_per_sample(enum CodecID 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_MULAW:
case CODEC_ID_PCM_S8:
diff --git a/libavformat/voc.c b/libavformat/voc.c
index 7fb8550..00eeac4 100644
--- a/libavformat/voc.c
+++ b/libavformat/voc.c
@@ -93,18 +93,6 @@ 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)
{
@@ -130,7 +118,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);
+ dec->bits_per_sample = av_get_bits_per_sample(dec->codec_id);
voc->remaining_size -= 2;
max_size -= 2;
channels = 1;
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list