]> git.sesse.net Git - vlc/blobdiff - modules/access/vcdx/info.c
Fix previous commit.
[vlc] / modules / access / vcdx / info.c
index 88b55ba1eafe4f87f8050f9c4b21d77296194c84..5d3d16f71b92532c028ed823f2e4e987c6241433 100644 (file)
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_input.h>
 #include <vlc_access.h>
 #include "vcd.h"
-#include <vlc_playlist.h>
 #include <vlc_keys.h>
 #include "info.h"
 
@@ -176,10 +175,11 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
 
   if ( CDIO_INVALID_TRACK != i_track )
   {
+    char* psz_title_format = config_GetPsz( p_access, MODULE_STRING "-title-format" );
     char *psz_name =
-      VCDFormatStr( p_access, p_vcdplayer,
-            config_GetPsz( p_access, MODULE_STRING "-title-format" ),
-            psz_mrl, &(p_vcdplayer->play_item) );
+      VCDFormatStr( p_access, p_vcdplayer, psz_title_format, psz_mrl,
+                    &(p_vcdplayer->play_item) );
+    free( psz_title_format );
  
     input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name );
   }
@@ -196,7 +196,7 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
         strncat(tp, str, TEMP_STR_LEN-(tp-temp_str));           \
         tp += len;                           \
       }                                                        \
-      saw_control_prefix = VLC_FALSE;                   \
+      saw_control_prefix = false;                   \
     }                                   \
   }
 
@@ -211,7 +211,7 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
       strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str));        \
       tp += len;                           \
     }                                   \
-    saw_control_prefix = VLC_FALSE;                                \
+    saw_control_prefix = false;                                \
   }
 
 /*!
@@ -246,7 +246,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer,
   static char    temp_str[TEMP_STR_SIZE];
   size_t         i;
   char *         tp = temp_str;
-  vlc_bool_t     saw_control_prefix = VLC_FALSE;
+  bool     saw_control_prefix = false;
   size_t         format_len = strlen(format_str);
 
   memset(temp_str, 0, TEMP_STR_SIZE);
@@ -255,7 +255,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer,
 
     if (!saw_control_prefix && format_str[i] != '%') {
       *tp++ = format_str[i];
-      saw_control_prefix = VLC_FALSE;
+      saw_control_prefix = false;
       continue;
     }
 
@@ -310,7 +310,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer,
           /* What to do? */
           ;
         }
-        saw_control_prefix = VLC_FALSE;
+        saw_control_prefix = false;
       }
       break;
 
@@ -321,7 +321,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer,
         strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str));
         tp += strlen(num_str);
       }
-      saw_control_prefix = VLC_FALSE;
+      saw_control_prefix = false;
       break;
 
     case 'M':
@@ -349,7 +349,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer,
         strncat(tp, seg_type_str, TEMP_STR_LEN-(tp-temp_str));
         tp += strlen(seg_type_str);
       }
-      saw_control_prefix = VLC_FALSE;
+      saw_control_prefix = false;
       break;
 
     case 'T':
@@ -367,7 +367,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer,
     default:
       *tp++ = '%';
       *tp++ = format_str[i];
-      saw_control_prefix = VLC_FALSE;
+      saw_control_prefix = false;
     }
   }
   return strdup(temp_str);
@@ -386,14 +386,14 @@ VCDUpdateTitle( access_t *p_access )
     if( psz_mrl )
     {
         char *psz_name;
-    snprintf(psz_mrl, psz_mrl_max, "%s%s",
-         VCD_MRL_PREFIX, p_vcdplayer->psz_source);
-    psz_name = VCDFormatStr( p_access, p_vcdplayer,
-                 config_GetPsz( p_access, MODULE_STRING
-                        "-title-format" ),
-                psz_mrl, &(p_vcdplayer->play_item) );
-    input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name );
-    free(psz_mrl);
+        char* psz_title_format = config_GetPsz( p_access, MODULE_STRING "-title-format" );
+        snprintf( psz_mrl, psz_mrl_max, "%s%s",
+                  VCD_MRL_PREFIX, p_vcdplayer->psz_source );
+        psz_name = VCDFormatStr( p_access, p_vcdplayer, psz_title_format, psz_mrl,
+                                 &(p_vcdplayer->play_item) );
+        input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name );
+        free( psz_title_format );
+        free(psz_mrl);
     }
 }