[FFmpeg-cvslog] r20429 - in trunk: libavcodec/smacker.c libavformat/smacker.c

jbr subversion
Sun Nov 1 16:08:49 CET 2009


Author: jbr
Date: Sun Nov  1 16:08:49 2009
New Revision: 20429

Log:
Set the sample format for Smacker audio in the decoder rather than in the 
demuxer.

Modified:
   trunk/libavcodec/smacker.c
   trunk/libavformat/smacker.c

Modified: trunk/libavcodec/smacker.c
==============================================================================
--- trunk/libavcodec/smacker.c	Sat Oct 31 17:33:38 2009	(r20428)
+++ trunk/libavcodec/smacker.c	Sun Nov  1 16:08:49 2009	(r20429)
@@ -555,6 +555,7 @@ static av_cold int decode_end(AVCodecCon
 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;
 }
 

Modified: trunk/libavformat/smacker.c
==============================================================================
--- trunk/libavformat/smacker.c	Sat Oct 31 17:33:38 2009	(r20428)
+++ trunk/libavformat/smacker.c	Sun Nov  1 16:08:49 2009	(r20429)
@@ -183,7 +183,6 @@ static int smacker_read_header(AVFormatC
             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);
         }



More information about the ffmpeg-cvslog mailing list