Commit 05e3f2f7 authored by Steve Lhomme's avatar Steve Lhomme

mkv.cpp: the UI hook is always on

parent f5637674
...@@ -1235,6 +1235,7 @@ public: ...@@ -1235,6 +1235,7 @@ public:
,p_ev(NULL) ,p_ev(NULL)
{ {
vlc_mutex_init( &demuxer, &lock_demuxer ); vlc_mutex_init( &demuxer, &lock_demuxer );
StartUiThread();
} }
virtual ~demux_sys_t() virtual ~demux_sys_t()
...@@ -1940,7 +1941,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -1940,7 +1941,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
/* add all es */ /* add all es */
msg_Dbg( &sys.demuxer, "found %d es", tracks.size() ); msg_Dbg( &sys.demuxer, "found %d es", tracks.size() );
sys.StopUiThread();
for( i_track = 0; i_track < tracks.size(); i_track++ ) for( i_track = 0; i_track < tracks.size(); i_track++ )
{ {
if( tracks[i_track]->fmt.i_cat == UNKNOWN_ES ) if( tracks[i_track]->fmt.i_cat == UNKNOWN_ES )
...@@ -2220,7 +2221,6 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -2220,7 +2221,6 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
else if( !strcmp( tracks[i_track]->psz_codec, "B_VOBBTN" ) ) else if( !strcmp( tracks[i_track]->psz_codec, "B_VOBBTN" ) )
{ {
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's','p','u',' ' ); tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's','p','u',' ' );
sys.StartUiThread();
} }
else else
{ {
...@@ -2441,6 +2441,8 @@ int demux_sys_t::EventThread( vlc_object_t *p_this ) ...@@ -2441,6 +2441,8 @@ int demux_sys_t::EventThread( vlc_object_t *p_this )
p_sys->dvd_interpretor.SetSPRM( 0x88, best ); p_sys->dvd_interpretor.SetSPRM( 0x88, best );
p_sys->dvd_interpretor.Interpret( button_ptr.cmd.bytes, 8 ); p_sys->dvd_interpretor.Interpret( button_ptr.cmd.bytes, 8 );
msg_Dbg( &p_sys->demuxer, "Processed button %d", best );
// select new button // select new button
if ( best != p_sys->i_curr_button ) if ( best != p_sys->i_curr_button )
{ {
...@@ -2532,8 +2534,6 @@ void matroska_segment_c::UnSelect( ) ...@@ -2532,8 +2534,6 @@ void matroska_segment_c::UnSelect( )
{ {
size_t i_track; size_t i_track;
sys.StopUiThread();
for( i_track = 0; i_track < tracks.size(); i_track++ ) for( i_track = 0; i_track < tracks.size(); i_track++ )
{ {
if ( tracks[i_track]->p_es != NULL ) if ( tracks[i_track]->p_es != NULL )
...@@ -2937,6 +2937,9 @@ static void Seek( demux_t *p_demux, mtime_t i_date, double f_percent, chapter_it ...@@ -2937,6 +2937,9 @@ static void Seek( demux_t *p_demux, mtime_t i_date, double f_percent, chapter_it
static int Demux( demux_t *p_demux) static int Demux( demux_t *p_demux)
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
vlc_mutex_lock( &p_sys->lock_demuxer );
virtual_segment_c *p_vsegment = p_sys->p_current_segment; virtual_segment_c *p_vsegment = p_sys->p_current_segment;
matroska_segment_c *p_segment = p_vsegment->Segment(); matroska_segment_c *p_segment = p_vsegment->Segment();
if ( p_segment == NULL ) return 0; if ( p_segment == NULL ) return 0;
...@@ -2948,8 +2951,6 @@ static int Demux( demux_t *p_demux) ...@@ -2948,8 +2951,6 @@ static int Demux( demux_t *p_demux)
int64_t i_block_ref1; int64_t i_block_ref1;
int64_t i_block_ref2; int64_t i_block_ref2;
vlc_mutex_lock( &p_sys->lock_demuxer );
for( ;; ) for( ;; )
{ {
if ( p_sys->demuxer.b_die ) if ( p_sys->demuxer.b_die )
......
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