[SCM] libav/experimental: Set the sample format for Smacker audio in the decoder rather than in the demuxer.
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:53:55 UTC 2013
The following commit has been merged in the experimental branch:
commit dee34af4d6eec7cfb2f96e81d6b7f5719a04a866
Author: Justin Ruggles <justin.ruggles at gmail.com>
Date: Sun Nov 1 15:08:49 2009 +0000
Set the sample format for Smacker audio in the decoder rather than in the
demuxer.
Originally committed as revision 20429 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 18eaebc..19f0b28 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -555,6 +555,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
static av_cold int smka_decode_init(AVCodecContext *avctx)
{
avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
+ avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? SAMPLE_FMT_U8 : SAMPLE_FMT_S16;
return 0;
}
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 7d0a8d5..8ec28bc 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -183,7 +183,6 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;
if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8)
ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
- ast[i]->codec->sample_fmt = ast[i]->codec->bits_per_coded_sample == 8 ? SAMPLE_FMT_U8 : SAMPLE_FMT_S16;
av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate
* ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8);
}
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list