]> git.sesse.net Git - vlc/blobdiff - modules/demux/tta.c
Add m2ts and mts to the interface dialog selectors.
[vlc] / modules / demux / tta.c
index f2dd5d11dff25bcf7eedcd670df433eb48aee275..42fda085f9708d3cad36a4218b3826b07e7b6d66 100644 (file)
@@ -28,7 +28,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_demux.h>
 #include <vlc_codec.h>
 #include <math.h>
@@ -41,10 +42,10 @@ static void Close ( vlc_object_t * );
 
 vlc_module_begin();
     set_shortname( "TTA" );
-    set_description( _("TTA demuxer") );
+    set_description( N_("TTA demuxer") );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_DEMUX );
-    set_capability( "demux2", 145 );
+    set_capability( "demux", 145 );
 
     set_callbacks( Open, Close );
     add_shortcut( "tta" );
@@ -110,7 +111,7 @@ static int Open( vlc_object_t * p_this )
     p_demux->pf_control = Control;
     p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
     if( !p_sys )
-        return VLC_EGENERIC;
+        return VLC_ENOMEM;
 
     /* Read the metadata */
     es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'T', 'T', 'A', '1' ) );
@@ -130,7 +131,7 @@ static int Open( vlc_object_t * p_this )
     if( !p_seektable )
     {
         free( p_sys );
-        return VLC_EGENERIC;
+        return VLC_ENOMEM;
     }
 
     stream_Read( p_demux->s, p_seektable, i_seektable_size );
@@ -139,7 +140,7 @@ static int Open( vlc_object_t * p_this )
     {
         free( p_seektable );
         free( p_sys );
-        return VLC_EGENERIC;
+        return VLC_ENOMEM;
     }
 
     for( i = 0; i < p_sys->i_totalframes; i++ )
@@ -155,7 +156,7 @@ static int Open( vlc_object_t * p_this )
         free( p_sys->pi_seektable );
         free( p_seektable );
         free( p_sys );
-        return VLC_EGENERIC;
+        return VLC_ENOMEM;
     }
     memcpy( (uint8_t*)fmt.p_extra, p_header, 22 );
     memcpy( (uint8_t*)fmt.p_extra+22, p_seektable, fmt.i_extra -22 );
@@ -194,7 +195,7 @@ static int Demux( demux_t *p_demux )
 
     p_data = stream_Block( p_demux->s, p_sys->pi_seektable[p_sys->i_currentframe] );
     if( p_data == NULL ) return 0;
-    p_data->i_dts = p_data->i_pts = (int64_t)(1 + I64C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
+    p_data->i_dts = p_data->i_pts = (int64_t)(1 + INT64_C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
 
     p_sys->i_currentframe++;
 
@@ -248,12 +249,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_GET_LENGTH:
             pi64 = (int64_t*)va_arg( args, int64_t * );
-            *pi64 = I64C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME;
+            *pi64 = INT64_C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME;
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
             pi64 = (int64_t*)va_arg( args, int64_t * );
-            *pi64 = I64C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME;
+            *pi64 = INT64_C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME;
             return VLC_SUCCESS;
 
         default: