[vlc-commits] input: add an input_item_t arg to input_CreateFilename()

Thomas Guillem git at videolan.org
Fri Jul 20 17:23:14 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jul 19 14:12:49 2018 +0200| [d096f149d8135e047f648a6744e57c1b2cbe05d5] | committer: Thomas Guillem

input: add an input_item_t arg to input_CreateFilename()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d096f149d8135e047f648a6744e57c1b2cbe05d5
---

 include/vlc_input.h            | 4 +++-
 modules/stream_filter/record.c | 2 +-
 src/input/es_out.c             | 3 ++-
 src/input/input.c              | 7 ++++---
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index 73bdc41fd9..1e47b96772 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -700,7 +700,9 @@ VLC_API void input_DecoderFlush( decoder_t * );
 /**
  * This function creates a sane filename path.
  */
-VLC_API char * input_CreateFilename( input_thread_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) VLC_USED;
+VLC_API char * input_CreateFilename( input_thread_t *, input_item_t *,
+                                     const char *psz_path, const char *psz_prefix,
+                                     const char *psz_extension ) VLC_USED;
 
 /**
  * It creates an empty input resource handler.
diff --git a/modules/stream_filter/record.c b/modules/stream_filter/record.c
index fef5cb5af8..d35fba73a9 100644
--- a/modules/stream_filter/record.c
+++ b/modules/stream_filter/record.c
@@ -180,7 +180,7 @@ static int Start( stream_t *s, const char *psz_extension )
 
     /* Create file name
      * TODO allow prefix configuration */
-    psz_file = input_CreateFilename( s->p_input, psz_path, INPUT_RECORD_PREFIX, psz_extension );
+    psz_file = input_CreateFilename( s->p_input, NULL, psz_path, INPUT_RECORD_PREFIX, psz_extension );
 
     free( psz_path );
 
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 9e44210de3..9728fe5279 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -507,7 +507,8 @@ static int EsOutSetRecord(  es_out_t *out, bool b_record )
 
         if( !psz_sout && psz_path )
         {
-            char *psz_file = input_CreateFilename( p_input, psz_path, INPUT_RECORD_PREFIX, NULL );
+            char *psz_file = input_CreateFilename( p_input, NULL, psz_path,
+                                                   INPUT_RECORD_PREFIX, NULL );
             if( psz_file )
             {
                 char* psz_file_esc = config_StringEscape( psz_file );
diff --git a/src/input/input.c b/src/input/input.c
index 85997ef241..9b2dd554c8 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -3343,11 +3343,12 @@ static char *input_SubtitleFile2Uri( input_thread_t *p_input,
 
 /**/
 /* TODO FIXME nearly the same logic that snapshot code */
-char *input_CreateFilename(input_thread_t *input, const char *dir,
-                           const char *filenamefmt, const char *ext)
+char *input_CreateFilename(input_thread_t *input, input_item_t *item,
+                           const char *dir, const char *filenamefmt,
+                           const char *ext)
 {
     char *path;
-    char *filename = str_format(input, NULL, filenamefmt);
+    char *filename = str_format(input, item, filenamefmt);
     if (unlikely(filename == NULL))
         return NULL;
 



More information about the vlc-commits mailing list