[vlc-commits] input_CreateFilename: take explicit input thread pointer

Rémi Denis-Courmont git at videolan.org
Wed Jan 1 19:51:45 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan  1 20:31:26 2014 +0200| [0180a3d4deabad731915d81e9709732b754e7c9b] | committer: Rémi Denis-Courmont

input_CreateFilename: take explicit input thread pointer

This should fix meta-data expansion in LibVLC (i.e. when recording).

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

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

diff --git a/include/vlc_input.h b/include/vlc_input.h
index 832c76c..53e22b6 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -607,7 +607,7 @@ VLC_API void input_DecoderDecode( decoder_t *, block_t *, bool b_do_pace );
 /**
  * This function creates a sane filename path.
  */
-VLC_API char * input_CreateFilename( vlc_object_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) VLC_USED;
+VLC_API char * input_CreateFilename( input_thread_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 8194dcc..538d506 100644
--- a/modules/stream_filter/record.c
+++ b/modules/stream_filter/record.c
@@ -184,7 +184,7 @@ static int Start( stream_t *s, const char *psz_extension )
 
     /* Create file name
      * TODO allow prefix configuration */
-    psz_file = input_CreateFilename( VLC_OBJECT(s), psz_path, INPUT_RECORD_PREFIX, psz_extension );
+    psz_file = input_CreateFilename( s->p_input, 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 78135ad..b41460f 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -461,7 +461,7 @@ static int EsOutSetRecord(  es_out_t *out, bool b_record )
 
         if( !psz_sout && psz_path )
         {
-            char *psz_file = input_CreateFilename( VLC_OBJECT(p_input), psz_path, INPUT_RECORD_PREFIX, NULL );
+            char *psz_file = input_CreateFilename( p_input, psz_path, INPUT_RECORD_PREFIX, NULL );
             if( psz_file )
             {
                 if( asprintf( &psz_sout, "#record{dst-prefix='%s'}", psz_file ) < 0 )
diff --git a/src/input/input.c b/src/input/input.c
index ea11bca..551e55a 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -55,7 +55,6 @@
 #include <vlc_fs.h>
 #include <vlc_strings.h>
 #include <vlc_modules.h>
-#include <vlc_playlist.h> // FIXME
 
 /*****************************************************************************
  * Local prototypes
@@ -3103,10 +3102,8 @@ void input_UpdateStatistic( input_thread_t *p_input,
 
 /**/
 /* TODO FIXME nearly the same logic that snapshot code */
-char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const char *psz_prefix, const char *psz_extension )
+char *input_CreateFilename( input_thread_t *input, const char *psz_path, const char *psz_prefix, const char *psz_extension )
 {
-    playlist_t *pl = pl_Get(p_obj);
-    input_thread_t *input = playlist_CurrentInput(pl);
     char *psz_file;
     DIR *path;
 



More information about the vlc-commits mailing list