]> git.sesse.net Git - vlc/blobdiff - modules/demux/mkv.cpp
mkv: Remove an unneeded test.
[vlc] / modules / demux / mkv.cpp
index 073bb56eb750d84cb7847fb11b4f3fbf019c5662..39408e7136067eced09e36c085f97d0e1e1746e8 100644 (file)
  * 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 <inttypes.h>
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 
 #ifdef HAVE_TIME_H
@@ -43,7 +46,7 @@
 
 
 #include <vlc_codecs.h>               /* BITMAPINFOHEADER, WAVEFORMATEX */
-#include "iso_lang.h"
+#include <vlc_iso_lang.h>
 #include "vlc_meta.h"
 #include <vlc_charset.h>
 #include <vlc_input.h>
@@ -402,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 );
@@ -503,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 );
 }
@@ -1048,10 +1051,7 @@ public:
     {
         for( size_t i_track = 0; i_track < tracks.size(); i_track++ )
         {
-            if ( tracks[i_track]->p_compression_data )
-            {
-                delete tracks[i_track]->p_compression_data;
-            }
+            delete tracks[i_track]->p_compression_data;
             es_format_Clean( &tracks[i_track]->fmt );
             free( tracks[i_track]->p_extra_data );
             free( tracks[i_track]->psz_codec );
@@ -1683,7 +1683,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* );
@@ -1695,7 +1695,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;
@@ -2551,7 +2550,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" ) )
         {
@@ -2602,7 +2600,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' );
@@ -2795,7 +2792,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 )
         {
@@ -3053,7 +3050,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 );
@@ -5217,7 +5214,7 @@ void matroska_segment_c::InformationCreate( )
 
 
 /*****************************************************************************
- * Divers
+ * Misc
  *****************************************************************************/
 
 void matroska_segment_c::IndexAppendCluster( KaxCluster *cluster )