bool input_DecoderIsEmpty( decoder_t * p_dec )
{
- assert( !p_dec->p_owner->b_buffering );
+ decoder_owner_sys_t *p_owner = p_dec->p_owner;
+ assert( !p_owner->b_buffering );
- /* FIXME that's not really true */
- return block_FifoCount( p_dec->p_owner->p_fifo ) <= 0;
+ bool b_empty = block_FifoCount( p_dec->p_owner->p_fifo ) <= 0;
+ if( b_empty )
+ {
+ vlc_mutex_lock( &p_owner->lock );
+ /* TODO audio support */
+ if( p_dec->fmt_out.i_cat == VIDEO_ES && p_owner->p_vout )
+ b_empty = vout_IsEmpty( p_owner->p_vout );
+ vlc_mutex_unlock( &p_owner->lock );
+ }
+ return b_empty;
}
void input_DecoderIsCcPresent( decoder_t *p_dec, bool pb_present[4] )
vout_control_WaitEmpty(&vout->p->control);
}
+bool vout_IsEmpty(vout_thread_t *vout)
+{
+ vlc_mutex_lock(&vout->p->picture_lock);
+
+ picture_t *picture = picture_fifo_Peek(vout->p->decoder_fifo);
+ if (picture)
+ picture_Release(picture);
+
+ vlc_mutex_unlock(&vout->p->picture_lock);
+
+ return !picture;
+}
+
void vout_FixLeaks( vout_thread_t *vout )
{
vlc_mutex_lock(&vout->p->picture_lock);
*/
void vout_DisplayTitle( vout_thread_t *p_vout, const char *psz_title );
+/**
+ * This function will return true if no more pictures are to be displayed.
+ */
+bool vout_IsEmpty( vout_thread_t *p_vout );
+
#endif