[vlc-commits] input_item: add input_item_CreateFilename

Thomas Guillem git at videolan.org
Mon Jun 3 16:16:24 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 31 12:39:16 2019 +0200| [80bcf667d3127fb3feff2d9d940994510109a607] | committer: Thomas Guillem

input_item: add input_item_CreateFilename

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

 include/vlc_input.h      |  6 ------
 include/vlc_input_item.h | 13 +++++++++++++
 src/input/item.c         |  7 +++++++
 src/libvlccore.sym       |  1 +
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index 7a9db09fdb..15695533d2 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -224,12 +224,6 @@ struct input_thread_t
     struct vlc_object_t obj;
 };
 
-/**
- * Record prefix string.
- * TODO make it configurable.
- */
-#define INPUT_RECORD_PREFIX "vlc-record-%Y-%m-%d-%Hh%Mm%Ss-$ N-$ p"
-
 /*****************************************************************************
  * Input events and variables
  *****************************************************************************/
diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 97975e4603..b68c24dc49 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -372,6 +372,19 @@ VLC_API input_item_t *input_item_Hold(input_item_t *);
 VLC_API void input_item_Release(input_item_t *);
 
 /**
+ * Record prefix string.
+ * TODO make it configurable.
+ */
+#define INPUT_RECORD_PREFIX "vlc-record-%Y-%m-%d-%Hh%Mm%Ss-$ N-$ p"
+
+/**
+ * This function creates a sane filename path.
+ */
+VLC_API char * input_item_CreateFilename( input_item_t *,
+                                          const char *psz_path, const char *psz_prefix,
+                                          const char *psz_extension ) VLC_USED;
+
+/**
  * input item parser opaque structure
  */
 typedef struct input_item_parser_id_t input_item_parser_id_t;
diff --git a/src/input/item.c b/src/input/item.c
index c8558b6327..4b65d02ed6 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1325,6 +1325,13 @@ void input_item_UpdateTracksInfo(input_item_t *item, const es_format_t *fmt)
     vlc_mutex_unlock( &item->lock );
 }
 
+char *input_item_CreateFilename(input_item_t *item,
+                                const char *dir, const char *filenamefmt,
+                                const char *ext)
+{
+    return input_CreateFilename(NULL, item, dir, filenamefmt, ext);
+}
+
 struct input_item_parser_id_t
 {
     input_thread_t *input;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index f7e385cc96..2b965de065 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -176,6 +176,7 @@ input_item_AddOptions
 input_item_AddOpaque
 input_item_Copy
 input_item_CopyOptions
+input_item_CreateFilename
 input_item_DelInfo
 input_item_GetDuration
 input_item_GetInfo



More information about the vlc-commits mailing list