]> git.sesse.net Git - vlc/commitdiff
transcode -- prevent user error, limit mp3 channels to max of 2
authorMark Moriarty <markfm@videolan.org>
Sun, 6 Mar 2005 14:48:14 +0000 (14:48 +0000)
committerMark Moriarty <markfm@videolan.org>
Sun, 6 Mar 2005 14:48:14 +0000 (14:48 +0000)
modules/stream_out/transcode.c

index 87f66fc374385c5d41e626ad576c475af1627c3c..97611f824abd4cb646bc7f56915dad9b8653200c 100644 (file)
@@ -370,6 +370,13 @@ static int Open( vlc_object_t *p_this )
 
     if( p_sys->i_acodec )
     {
+           if ( ( strncmp( (char *)&p_sys->i_acodec, "mp3", 3) == 0 ) && 
+                  ( p_sys->i_channels > 2 ) )
+           {
+                  msg_Warn( p_stream, "%d channels invalid for mp3, forcing to 2", 
+                     p_sys->i_channels);
+                  p_sys->i_channels = 2;    
+           }
         msg_Dbg( p_stream, "codec audio=%4.4s %dHz %d channels %dKb/s",
                  (char *)&p_sys->i_acodec, p_sys->i_sample_rate,
                  p_sys->i_channels, p_sys->i_abitrate / 1000 );