]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/oss.c
* ALL: More hooks for audio volume management.
[vlc] / modules / audio_output / oss.c
index 6e90414f63e385ed3987839b5c8b55813533072c..c3c3582a32e4ad836b1d2b99dd9917bd659c503f 100644 (file)
@@ -2,7 +2,7 @@
  * oss.c : OSS /dev/dsp module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2002 VideoLAN
- * $Id: oss.c,v 1.24 2002/09/11 23:10:30 stef Exp $
+ * $Id: oss.c,v 1.26 2002/09/18 21:21:23 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -164,11 +164,15 @@ static int Open( vlc_object_t *p_this )
         p_aout->output.i_nb_samples = A52_FRAME_NB;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
         p_aout->output.output.i_frame_length = A52_FRAME_NB;
+
+        aout_VolumeNoneInit( p_aout );
     }
     else
     {
         p_aout->output.output.i_format = i_format = AOUT_FMT_S16_NE;
         p_aout->output.i_nb_samples = FRAME_SIZE;
+
+        aout_VolumeSoftInit( p_aout );
     }
 
     if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0
@@ -318,7 +322,7 @@ static int OSSThread( aout_instance_t * p_aout )
 
     while ( !p_aout->b_die )
     {
-        aout_buffer_t * p_buffer;
+        aout_buffer_t * p_buffer = NULL;
         int i_tmp, i_size;
         byte_t * p_bytes;
 
@@ -366,13 +370,12 @@ static int OSSThread( aout_instance_t * p_aout )
                 }
             }
             
-            while( ! ( p_buffer =
+            while( !p_aout->b_die && ! ( p_buffer =
                 aout_OutputNextBuffer( p_aout, next_date, VLC_TRUE ) ) )
             {
-                msleep( 10000 );
+                msleep( 1000 );
                 next_date = mdate();
             }
-
         }
 
         if ( p_buffer != NULL )