Special case for fourcc samr and sawb in transcode_audio_new()
authorJean-Paul Saman <jpsaman@videolan.org>
Wed, 2 Jan 2008 09:50:41 +0000 (09:50 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Wed, 2 Jan 2008 09:50:41 +0000 (09:50 +0000)
modules/stream_out/transcode.c

index 3bc217b..63c31ff 100644 (file)
@@ -1349,7 +1349,11 @@ static int transcode_audio_new( sout_stream_t *p_stream,
                     id->p_decoder->fmt_out.i_codec );
     id->p_encoder->fmt_in.audio.i_format = id->p_decoder->fmt_out.i_codec;
 
-    id->p_encoder->fmt_in.audio.i_rate = id->p_encoder->fmt_out.audio.i_rate;
+    if( ( id->p_encoder->fmt_out.i_codec == VLC_FOURCC('s','a','m','r') ) ||
+        ( id->p_encoder->fmt_out.i_codec == VLC_FOURCC('s','a','w','b') ) )
+         id->p_encoder->fmt_in.audio.i_rate = id->p_encoder->fmt_out.audio.i_rate;
+    else
+        id->p_encoder->fmt_in.audio.i_rate = fmt_last.audio.i_rate;
     id->p_encoder->fmt_in.audio.i_physical_channels =
         id->p_encoder->fmt_out.audio.i_physical_channels;
     id->p_encoder->fmt_in.audio.i_original_channels =