Commit 7896b15f authored by Laurent Aimar's avatar Laurent Aimar

Fixed dmo decoder wrapper.

parent ededd634
...@@ -296,6 +296,8 @@ found: ...@@ -296,6 +296,8 @@ found:
vlc_cond_init( &p_sys->wait_output ); vlc_cond_init( &p_sys->wait_output );
p_sys->b_works = p_sys->b_works =
p_sys->b_ready = false; p_sys->b_ready = false;
p_sys->pp_input = NULL;
p_sys->p_output = NULL;
if( vlc_clone( &p_sys->thread, DecoderThread, p_dec, if( vlc_clone( &p_sys->thread, DecoderThread, p_dec,
VLC_THREAD_PRIORITY_INPUT ) ) VLC_THREAD_PRIORITY_INPUT ) )
...@@ -347,9 +349,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -347,9 +349,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->pp_input = pp_block; p_sys->pp_input = pp_block;
vlc_cond_signal( &p_sys->wait_input ); vlc_cond_signal( &p_sys->wait_input );
while( !(p_ret = p_sys->p_output) ) while( p_sys->pp_input )
vlc_cond_wait( &p_sys->wait_output, &p_sys->lock ); vlc_cond_wait( &p_sys->wait_output, &p_sys->lock );
p_sys->p_output = NULL; p_ret = p_sys->p_output;
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
return p_ret; return p_ret;
...@@ -1039,6 +1041,7 @@ static void *DecoderThread( void *data ) ...@@ -1039,6 +1041,7 @@ static void *DecoderThread( void *data )
p_sys->p_output = DecBlock( p_dec, p_sys->pp_input ); p_sys->p_output = DecBlock( p_dec, p_sys->pp_input );
p_sys->pp_input = NULL; p_sys->pp_input = NULL;
vlc_cond_signal( &p_sys->wait_output );
} }
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment