Browse code

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

Justin Ruggles authored on 2009/11/02 00:08:49
Showing 2 changed files
... ...
@@ -555,6 +555,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
555 555
 static av_cold int smka_decode_init(AVCodecContext *avctx)
556 556
 {
557 557
     avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
558
+    avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? SAMPLE_FMT_U8 : SAMPLE_FMT_S16;
558 559
     return 0;
559 560
 }
560 561
 
... ...
@@ -183,7 +183,6 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
183 183
             ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;
184 184
             if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8)
185 185
                 ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
186
-            ast[i]->codec->sample_fmt = ast[i]->codec->bits_per_coded_sample == 8 ? SAMPLE_FMT_U8 : SAMPLE_FMT_S16;
187 186
             av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate
188 187
                     * ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8);
189 188
         }