avcodec: set encoding sample format correctly and don't assume S16N
authorIlkka Ollakka <ileoo@videolan.org>
Sat, 29 Dec 2012 07:37:34 +0000 (09:37 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Sun, 30 Dec 2012 11:24:17 +0000 (13:24 +0200)
modules/codec/avcodec/encoder.c

index 0f0f169..0517e82 100644 (file)
@@ -595,7 +595,8 @@ int OpenEncoder( vlc_object_t *p_this )
         p_context->sample_fmt  = p_codec->sample_fmts ?
                                     p_codec->sample_fmts[0] :
                                     AV_SAMPLE_FMT_S16;
-        p_enc->fmt_in.i_codec  = VLC_CODEC_S16N;
+        p_enc->fmt_in.i_codec  = GetVlcAudioFormat( p_context->sample_fmt );
+
         p_context->sample_rate = p_enc->fmt_out.audio.i_rate;
         p_context->time_base.num = 1;
         p_context->time_base.den = p_context->sample_rate;