]> git.sesse.net Git - vlc/commitdiff
Use str_format_time() instead of str_format() in outputs
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 21 Aug 2012 18:18:17 +0000 (21:18 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 21 Aug 2012 18:31:54 +0000 (21:31 +0300)
There are several issues with str_format() and str_format_meta():
 - the current playlist item is used rather than the actual input,
 - the playlist gets activated for nothing,
 - they assume the output does not outlive to the input (item).

This mostly reverts commit cccd51a5b8026f20830aeec3473efa24553013c3.

modules/access_output/file.c
modules/access_output/livehttp.c
modules/video_filter/marq.c
src/video_output/snapshot.c

index 3ee0e8c342e17b3d7975326cd3798b66952717f3..97746851c8889a9506fb94adce94d347fa9bf5cd 100644 (file)
@@ -152,7 +152,7 @@ static int Open( vlc_object_t *p_this )
 #endif
     else
     {
-        char *psz_tmp = str_format( p_access, p_access->psz_path );
+        char *psz_tmp = str_format_time( p_access->psz_path );
         path_sanitize( psz_tmp );
 
         fd = vlc_open( psz_tmp, O_RDWR | O_CREAT | O_LARGEFILE |
index 63c56b125c7e22b0d8ca19d0853387b016c01b64..bca522b6176afd09aca6d66c39ac47d178ef1826 100644 (file)
@@ -173,7 +173,7 @@ static int Open( vlc_object_t *p_this )
     if ( psz_idx )
     {
         char *psz_tmp;
-        psz_tmp = str_format( p_access, psz_idx );
+        psz_tmp = str_format_time( psz_idx );
         free( psz_idx );
         if ( !psz_tmp )
         {
@@ -203,12 +203,12 @@ static int Open( vlc_object_t *p_this )
 /*****************************************************************************
  * formatSegmentPath: create segment path name based on seg #
  *****************************************************************************/
-static char *formatSegmentPath( sout_access_out_t *p_access, char *psz_path, uint32_t i_seg, bool b_sanitize )
+static char *formatSegmentPath( char *psz_path, uint32_t i_seg, bool b_sanitize )
 {
     char *psz_result;
     char *psz_firstNumSign;
 
-    if ( ! ( psz_result  = str_format( p_access, psz_path ) ) )
+    if ( ! ( psz_result  = str_format_time( psz_path ) ) )
         return NULL;
 
     psz_firstNumSign = psz_result + strcspn( psz_result, SEG_NUMBER_PLACEHOLDER );
@@ -272,7 +272,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
         for ( uint32_t i = i_firstseg; i <= p_sys->i_segment; i++ )
         {
             char *psz_name;
-            if ( ! ( psz_name = formatSegmentPath( p_access, psz_idxFormat, i, false ) ) )
+            if ( ! ( psz_name = formatSegmentPath( psz_idxFormat, i, false ) ) )
             {
                 free( psz_idxTmp );
                 fclose( fp );
@@ -316,7 +316,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
     // Then take care of deletion
     if ( p_sys->b_delsegs && i_firstseg > 1 )
     {
-        char *psz_name = formatSegmentPath( p_access, p_access->psz_path, i_firstseg-1, true );
+        char *psz_name = formatSegmentPath( p_access->psz_path, i_firstseg-1, true );
          if ( psz_name )
          {
              vlc_unlink( psz_name );
@@ -391,7 +391,7 @@ static ssize_t openNextFile( sout_access_out_t *p_access, sout_access_out_sys_t
 
     uint32_t i_newseg = p_sys->i_segment + 1;
 
-    char *psz_seg = formatSegmentPath( p_access, p_access->psz_path, i_newseg, true );
+    char *psz_seg = formatSegmentPath( p_access->psz_path, i_newseg, true );
     if ( !psz_seg )
         return -1;
 
index 890d99b302c2048739f2821001ffc7dd6c5cfe1c..c800230f0fa13da94b45eb2d205963c35a801495 100644 (file)
@@ -291,7 +291,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         }
     }
 
-    char *msg = str_format( p_filter, p_sys->format ? p_sys->format : "" );
+    char *msg = str_format_time( p_sys->format ? p_sys->format : "" );
     if( unlikely( msg == NULL ) )
         goto out;
     if( p_sys->message != NULL && !strcmp( msg, p_sys->message ) )
index 8ecac34b8e6a7fad007439aeba0aca5731a841cf..5accd89329dcd69dcf8bc89dcc149b0c0cd31e17 100644 (file)
@@ -149,7 +149,7 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
         /* */
         char *prefix = NULL;
         if (cfg->prefix_fmt)
-            prefix = str_format(object, cfg->prefix_fmt);
+            prefix = str_format_time(cfg->prefix_fmt);
         if (prefix)
             filename_sanitize(prefix);
         else {
@@ -202,7 +202,7 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
         free(prefix);
     } else {
         /* The user specified a full path name (including file name) */
-        filename = str_format(object, cfg->path);
+        filename = str_format_time(cfg->path);
         path_sanitize(filename);
     }