diff options
Diffstat (limited to 'src/xine-engine/audio_decoder.c')
-rw-r--r-- | src/xine-engine/audio_decoder.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 1b4c68457..b69908384 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_decoder.c,v 1.128 2004/04/26 17:50:12 mroi Exp $ + * $Id: audio_decoder.c,v 1.129 2004/07/06 22:53:22 miguelfreitas Exp $ * * * functions that implement audio decoding @@ -119,6 +119,25 @@ static void *audio_decoder_loop (void *stream_gen) { } first_header = last_header = NULL; } + + /* + * wait the output fifos to run dry before sending the notification event + * to the frontend. this test is only valid if there is only a single + * stream attached to the current output port. + */ + while(1) { + int num_bufs, num_streams; + + running_ticket->acquire(running_ticket, 0); + num_bufs = stream->audio_out->get_property(stream->audio_out, AO_PROP_BUFS_IN_FIFO); + num_streams = stream->audio_out->get_property(stream->audio_out, AO_PROP_NUM_STREAMS); + running_ticket->release(running_ticket, 0); + + if( num_bufs > 0 && num_streams == 1 ) + xine_usec_sleep (10000); + else + break; + } /* wait for video to reach this marker, if necessary */ pthread_mutex_lock (&stream->counter_lock); |