]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/waveout.c
input: Expose input_ItemHasErrorWhenReading.
[vlc] / modules / audio_output / waveout.c
index 2a57e01a558644006fc10abc30c6ca5517bfecbc..bf9ac039186fd44a0fb4954c82d4906ccbb77b7e 100644 (file)
@@ -245,10 +245,7 @@ static int Open( vlc_object_t *p_this )
     p_aout->output.p_sys = malloc( sizeof( aout_sys_t ) );
 
     if( p_aout->output.p_sys == NULL )
-    {
-        msg_Err( p_aout, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
 
     p_aout->output.pf_play = Play;
     p_aout->b_die = false;
@@ -411,7 +408,6 @@ static int Open( vlc_object_t *p_this )
     if( p_aout->output.p_sys->p_silence_buffer == NULL )
     {
         free( p_aout->output.p_sys );
-        msg_Err( p_aout, "out of memory" );
         return 1;
     }
     p_aout->output.p_sys->i_repeat_counter = 0;
@@ -912,7 +908,7 @@ static void CALLBACK WaveOutCallback( HWAVEOUT h_waveout, UINT uMsg,
 
     if( uMsg != WOM_DONE ) return;
 
-    if( p_aout->b_die ) return;
+    if( !vlc_object_alive (p_aout) ) return;
 
     /* Find out the current latency */
     for( i = 0; i < FRAMES_NUM; i++ )
@@ -988,9 +984,9 @@ static void WaveOutThread( notification_thread_t *p_notif )
     b_sleek = p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i');
 
     // wait for first call to "play()"
-    while( !p_sys->start_date && !p_aout->b_die )
+    while( !p_sys->start_date && vlc_object_alive (p_aout) )
            WaitForSingleObject( p_sys->event, INFINITE );
-    if( p_aout->b_die )
+    if( !vlc_object_alive (p_aout) )
         return;
 
     msg_Dbg( p_aout, "will start to play in %"PRId64" us",
@@ -1007,12 +1003,12 @@ static void WaveOutThread( notification_thread_t *p_notif )
                            p_aout->output.b_starving, msg);
     next_date = mdate();
 
-    while( !p_aout->b_die )
+    while( vlc_object_alive (p_aout) )
     {
         /* Cleanup and find out the current latency */
         i_queued_frames = WaveOutClearDoneBuffers( p_sys );
 
-        if( p_aout->b_die ) return;
+        if( !vlc_object_alive (p_aout) ) return;
 
         /* Try to fill in as many frame buffers as possible */
         for( i = 0; i < FRAMES_NUM; i++ )
@@ -1088,7 +1084,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
             }
         }
 
-        if( p_aout->b_die ) return;
+        if( !vlc_object_alive (p_aout) ) return;
 
         /*
           deal with the case that the loop didn't fillup the buffer to the