X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fmkv.cpp;h=70a55b6c0172238191a7ed859d47e3fde6260361;hb=975bd7b51a72dcb025885ddbc4862b333fdf26a6;hp=52a338407adeb371f3a58fa5dc9240c16c556623;hpb=53772811d1d5f1b2a22f36332a500ffac5eba29e;p=vlc diff --git a/modules/demux/mkv.cpp b/modules/demux/mkv.cpp index 52a338407a..70a55b6c01 100644 --- a/modules/demux/mkv.cpp +++ b/modules/demux/mkv.cpp @@ -26,15 +26,19 @@ * Preamble *****************************************************************************/ +/* config.h may include inttypes.h, so make sure we define that option + * early enough. */ +#define __STDC_FORMAT_MACROS 1 +#define __STDC_CONSTANT_MACROS 1 + #ifdef HAVE_CONFIG_H # include "config.h" #endif -#define __STDC_FORMAT_MACROS 1 -#define __STDC_CONSTANT_MACROS 1 #include -#include +#include +#include #ifdef HAVE_TIME_H # include /* time() */ @@ -42,7 +46,7 @@ #include /* BITMAPINFOHEADER, WAVEFORMATEX */ -#include "iso_lang.h" +#include #include "vlc_meta.h" #include #include @@ -401,7 +405,7 @@ static void Close( vlc_object_t * ); vlc_module_begin(); set_shortname( "Matroska" ); - set_description( _("Matroska stream demuxer" ) ); + set_description( N_("Matroska stream demuxer" ) ); set_capability( "demux", 50 ); set_callbacks( Open, Close ); set_category( CAT_INPUT ); @@ -502,7 +506,7 @@ static void MkvTree( demux_t & demuxer, int i_level, const char *psz_format, ... psz_foo2[ 4 * i_level ] = '+'; psz_foo2[ 4 * i_level + 1 ] = ' '; strcpy( &psz_foo2[ 4 * i_level + 2 ], psz_format ); - __msg_GenericVa( VLC_OBJECT(&demuxer), MSG_QUEUE_NORMAL, VLC_MSG_DBG, "mkv", psz_foo2, args ); + __msg_GenericVa( VLC_OBJECT(&demuxer),VLC_MSG_DBG, "mkv", psz_foo2, args ); free( psz_foo2 ); va_end( args ); } @@ -1326,7 +1330,7 @@ public: ,b_pci_packet_set(false) ,p_ev(NULL) { - vlc_mutex_init( &demuxer, &lock_demuxer ); + vlc_mutex_init( &lock_demuxer ); } virtual ~demux_sys_t() @@ -1682,7 +1686,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) return VLC_SUCCESS; case DEMUX_GET_TITLE_INFO: - if( p_sys->titles.size() ) + if( p_sys->titles.size() > 1 || ( p_sys->titles.size() == 1 && p_sys->titles[0]->i_seekpoint > 0 ) ) { input_title_t ***ppp_title = (input_title_t***)va_arg( args, input_title_t*** ); int *pi_int = (int*)va_arg( args, int* ); @@ -1694,7 +1698,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) { (*ppp_title)[i] = vlc_input_title_Duplicate( p_sys->titles[i] ); } - return VLC_SUCCESS; } return VLC_EGENERIC; @@ -2550,7 +2553,6 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) } tracks[i_track]->fmt.audio.i_blockalign = ( tracks[i_track]->fmt.audio.i_bitspersample + 7 ) / 8 * tracks[i_track]->fmt.audio.i_channels; } -#if 0 /* disabled due to the potential "S_KATE" namespace issue */ else if( !strcmp( tracks[i_track]->psz_codec, "S_KATE" ) ) { @@ -2601,7 +2603,6 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) i_extra += i_size[i]; } } -#endif else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/UTF8" ) ) { tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's', 'u', 'b', 't' ); @@ -2719,7 +2720,7 @@ void demux_sys_t::StartUiThread() p_ev = (event_thread_t *) vlc_object_create( &demuxer, sizeof( event_thread_t ) ); p_ev->p_demux = &demuxer; p_ev->b_die = false; - vlc_mutex_init( p_ev, &p_ev->lock ); + vlc_mutex_init( &p_ev->lock ); vlc_thread_create( p_ev, "mkv event thread handler", EventThread, VLC_THREAD_PRIORITY_LOW, false ); } @@ -2794,7 +2795,7 @@ int demux_sys_t::EventThread( vlc_object_t *p_this ) var_AddCallback( p_ev->p_libvlc, "key-action", EventKey, p_ev ); /* main loop */ - while( !p_ev->b_die ) + while( vlc_object_alive (p_ev) ) { if ( !p_sys->b_pci_packet_set ) { @@ -3052,7 +3053,7 @@ int demux_sys_t::EventThread( vlc_object_t *p_this ) } /* VOUT part */ - if( p_vout && p_vout->b_die ) + if( p_vout && !vlc_object_alive (p_vout) ) { var_DelCallback( p_vout, "mouse-moved", EventMouse, p_ev ); var_DelCallback( p_vout, "mouse-clicked", EventMouse, p_ev ); @@ -5216,7 +5217,7 @@ void matroska_segment_c::InformationCreate( ) /***************************************************************************** - * Divers + * Misc *****************************************************************************/ void matroska_segment_c::IndexAppendCluster( KaxCluster *cluster )