]> git.sesse.net Git - vlc/blobdiff - src/audio_output/dec.c
Don't clutter REGISTRY on windows...
[vlc] / src / audio_output / dec.c
index 5c15891460cdad0edfba0cce46883589f9bc649b..a9eb16ac117172f9050c36a25dd69513afe74856 100644 (file)
@@ -57,14 +57,25 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
     {
         msg_Err( p_aout, "too many audio channels (%u)",
                  p_format->i_channels );
-        goto error;
+        return NULL;
+    }
+    if( p_format->i_channels <= 0 )
+    {
+        msg_Err( p_aout, "no audio channels" );
+        return NULL;
     }
 
     if( p_format->i_rate > 192000 )
     {
         msg_Err( p_aout, "excessive audio sample frequency (%u)",
                  p_format->i_rate );
-        goto error;
+        return NULL;
+    }
+    if( p_format->i_rate < 4000 )
+    {
+        msg_Err( p_aout, "too low audio sample frequency (%u)",
+                 p_format->i_rate );
+        return NULL;
     }
 
     /* We can only be called by the decoder, so no need to lock
@@ -307,6 +318,11 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
         return -1;
     }
 
+#ifndef FIXME
+    /* This hack for #transcode{acodec=...}:display to work -- Courmisch */
+    if( i_input_rate == 0 )
+        i_input_rate = INPUT_RATE_DEFAULT;
+#endif
     if( i_input_rate > INPUT_RATE_DEFAULT * AOUT_MAX_INPUT_RATE ||
         i_input_rate < INPUT_RATE_DEFAULT / AOUT_MAX_INPUT_RATE )
     {