]> git.sesse.net Git - vlc/blobdiff - src/input/var.c
macosx: our crashreport-mail needs to be UTF8 if we want to use NSUTF8StringEncoding...
[vlc] / src / input / var.c
index 663e4b3e589311c0cfad79fb0b2ec1a189bd84a1..9cd9629ba9b6fa37daa41422566ee1df25d1093b 100644 (file)
@@ -69,6 +69,9 @@ typedef struct
 static void InputAddCallbacks( input_thread_t *, const vlc_input_callback_t * );
 static void InputDelCallbacks( input_thread_t *, const vlc_input_callback_t * );
 
+#ifdef CALLBACK /* For windows */
+# undef CALLBACK /* We don't care of this one here */
+#endif
 /* List all callbacks added by input */
 #define CALLBACK(name,cb) { name, cb }
 static const vlc_input_callback_t p_input_callbacks[] =
@@ -104,6 +107,8 @@ static const vlc_input_callback_t p_input_title_callbacks[] =
 {
     CALLBACK( "next-chapter", SeekpointCallback ),
     CALLBACK( "prev-chapter", SeekpointCallback ),
+
+    CALLBACK( NULL, NULL )
 };
 #undef CALLBACK
 
@@ -278,9 +283,12 @@ void input_ControlVarNavigation( input_thread_t *p_input )
 
     /* Create title and navigation */
     val.psz_string = malloc( sizeof("title ") + 5 );
+    if( !val.psz_string )
+        return;
+
     for( i = 0; i < p_input->p->i_title; i++ )
     {
-        vlc_value_t val2, text, text2;
+        vlc_value_t val2, text2;
         int j;
 
         /* Add Navigation entries */
@@ -294,8 +302,9 @@ void input_ControlVarNavigation( input_thread_t *p_input )
         if( p_input->p->title[i]->psz_name == NULL ||
             *p_input->p->title[i]->psz_name == '\0' )
         {
-            asprintf( &text.psz_string, _("Title %i"),
-                      i + p_input->p->i_title_offset );
+            if( asprintf( &text.psz_string, _("Title %i"),
+                      i + p_input->p->i_title_offset ) == -1 )
+                continue;
         }
         else
         {
@@ -317,8 +326,9 @@ void input_ControlVarNavigation( input_thread_t *p_input )
                 *p_input->p->title[i]->seekpoint[j]->psz_name == '\0' )
             {
                 /* Default value */
-                asprintf( &text2.psz_string, _("Chapter %i"),
-                          j + p_input->p->i_seekpoint_offset );
+                if( asprintf( &text2.psz_string, _("Chapter %i"),
+                          j + p_input->p->i_seekpoint_offset ) == -1 )
+                    continue;
             }
             else
             {
@@ -342,7 +352,7 @@ void input_ControlVarNavigation( input_thread_t *p_input )
 void input_ControlVarTitle( input_thread_t *p_input, int i_title )
 {
     input_title_t *t = p_input->p->title[i_title];
-    vlc_value_t val;
+    vlc_value_t val, text;
     int  i;
 
     /* Create/Destroy command variables */
@@ -353,8 +363,6 @@ void input_ControlVarTitle( input_thread_t *p_input, int i_title )
     }
     else if( var_Get( p_input, "next-chapter", &val ) != VLC_SUCCESS )
     {
-        vlc_value_t text;
-
         var_Create( p_input, "next-chapter", VLC_VAR_VOID );
         text.psz_string = _("Next chapter");
         var_Change( p_input, "next-chapter", VLC_VAR_SETTEXT, &text, NULL );
@@ -370,15 +378,15 @@ void input_ControlVarTitle( input_thread_t *p_input, int i_title )
     var_Change( p_input, "chapter", VLC_VAR_CLEARCHOICES, NULL, NULL );
     for( i = 0; i <  t->i_seekpoint; i++ )
     {
-        vlc_value_t text;
         val.i_int = i;
 
         if( t->seekpoint[i]->psz_name == NULL ||
             *t->seekpoint[i]->psz_name == '\0' )
         {
             /* Default value */
-            asprintf( &text.psz_string, _("Chapter %i"),
-                      i + p_input->p->i_seekpoint_offset );
+            if( asprintf( &text.psz_string, _("Chapter %i"),
+                      i + p_input->p->i_seekpoint_offset ) == -1 )
+                continue;
         }
         else
         {
@@ -460,6 +468,8 @@ void input_ConfigVarInit ( input_thread_t *p_input )
     var_Create( p_input, "can-pause", VLC_VAR_BOOL );
     val.b_bool = true; /* Fixed later*/
     var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL );
+    var_Create( p_input, "teletext-es", VLC_VAR_INTEGER );
+    var_SetInteger( p_input, "teletext-es", -1 );
 
     /* */
     var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );