Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
9cd91f92
Commit
9cd91f92
authored
Aug 21, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
str_format_meta(): take playlist as parameter directly
Also inline str_format().
parent
b55ddc8f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
24 deletions
+15
-24
include/vlc_strings.h
include/vlc_strings.h
+9
-4
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+1
-1
src/input/input.c
src/input/input.c
+3
-2
src/libvlccore.sym
src/libvlccore.sym
+0
-1
src/text/strings.c
src/text/strings.c
+2
-16
No files found.
include/vlc_strings.h
View file @
9cd91f92
...
@@ -45,10 +45,15 @@ VLC_API size_t vlc_b64_decode_binary( uint8_t **pp_dst, const char *psz_src );
...
@@ -45,10 +45,15 @@ VLC_API size_t vlc_b64_decode_binary( uint8_t **pp_dst, const char *psz_src );
VLC_API
char
*
vlc_b64_decode
(
const
char
*
psz_src
);
VLC_API
char
*
vlc_b64_decode
(
const
char
*
psz_src
);
VLC_API
char
*
str_format_time
(
const
char
*
);
VLC_API
char
*
str_format_time
(
const
char
*
);
VLC_API
char
*
str_format_meta
(
vlc_object_t
*
,
const
char
*
);
VLC_API
char
*
str_format_meta
(
playlist_t
*
,
const
char
*
);
#define str_format_meta( a, b ) str_format_meta( VLC_OBJECT( a ), b )
VLC_API
char
*
str_format
(
vlc_object_t
*
,
const
char
*
);
static
inline
char
*
str_format
(
playlist_t
*
pl
,
const
char
*
fmt
)
#define str_format( a, b ) str_format( VLC_OBJECT( a ), b )
{
char
*
s1
=
str_format_time
(
fmt
);
char
*
s2
=
str_format_meta
(
pl
,
s1
);
free
(
s1
);
return
s2
;
}
VLC_API
void
filename_sanitize
(
char
*
);
VLC_API
void
filename_sanitize
(
char
*
);
VLC_API
void
path_sanitize
(
char
*
);
VLC_API
void
path_sanitize
(
char
*
);
...
...
modules/gui/qt4/input_manager.cpp
View file @
9cd91f92
...
@@ -484,7 +484,7 @@ void InputManager::UpdateName()
...
@@ -484,7 +484,7 @@ void InputManager::UpdateName()
/* Try to get the nowplaying */
/* Try to get the nowplaying */
char
*
format
=
var_InheritString
(
p_intf
,
"input-title-format"
);
char
*
format
=
var_InheritString
(
p_intf
,
"input-title-format"
);
char
*
formated
=
str_format_meta
(
p_input
,
format
);
char
*
formated
=
str_format_meta
(
THEPL
,
format
);
free
(
format
);
free
(
format
);
name
=
qfu
(
formated
);
name
=
qfu
(
formated
);
free
(
formated
);
free
(
formated
);
...
...
src/input/input.c
View file @
9cd91f92
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
#include <vlc_fs.h>
#include <vlc_fs.h>
#include <vlc_strings.h>
#include <vlc_strings.h>
#include <vlc_modules.h>
#include <vlc_modules.h>
#include <vlc_playlist.h> // FIXME
/*****************************************************************************
/*****************************************************************************
* Local prototypes
* Local prototypes
...
@@ -3237,7 +3238,7 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
...
@@ -3237,7 +3238,7 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
{
{
closedir
(
path
);
closedir
(
path
);
char
*
psz_tmp
=
str_format
(
p
_obj
,
psz_prefix
);
char
*
psz_tmp
=
str_format
(
p
l_Get
(
p_obj
)
,
psz_prefix
);
if
(
!
psz_tmp
)
if
(
!
psz_tmp
)
return
NULL
;
return
NULL
;
...
@@ -3253,7 +3254,7 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
...
@@ -3253,7 +3254,7 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
}
}
else
else
{
{
psz_file
=
str_format
(
p
_obj
,
psz_path
);
psz_file
=
str_format
(
p
l_Get
(
p_obj
)
,
psz_path
);
path_sanitize
(
psz_file
);
path_sanitize
(
psz_file
);
return
psz_file
;
return
psz_file
;
}
}
...
...
src/libvlccore.sym
View file @
9cd91f92
...
@@ -402,7 +402,6 @@ stream_Read
...
@@ -402,7 +402,6 @@ stream_Read
stream_ReadLine
stream_ReadLine
stream_UrlNew
stream_UrlNew
stream_vaControl
stream_vaControl
str_format
str_format_meta
str_format_meta
str_format_time
str_format_time
str_duration
str_duration
...
...
src/text/strings.c
View file @
9cd91f92
...
@@ -527,8 +527,7 @@ static void format_duration (char *buf, size_t len, int64_t duration)
...
@@ -527,8 +527,7 @@ static void format_duration (char *buf, size_t len, int64_t duration)
memcpy( dst+d, string, len ); \
memcpy( dst+d, string, len ); \
d += len; \
d += len; \
}
}
#undef str_format_meta
char
*
str_format_meta
(
playlist_t
*
p_object
,
const
char
*
string
)
char
*
str_format_meta
(
vlc_object_t
*
p_object
,
const
char
*
string
)
{
{
const
char
*
s
=
string
;
const
char
*
s
=
string
;
bool
b_is_format
=
false
;
bool
b_is_format
=
false
;
...
@@ -539,7 +538,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
...
@@ -539,7 +538,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
if
(
!
dst
)
return
NULL
;
if
(
!
dst
)
return
NULL
;
int
d
=
0
;
int
d
=
0
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p
l_Get
(
p_object
)
);
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p
_object
);
input_item_t
*
p_item
=
NULL
;
input_item_t
*
p_item
=
NULL
;
if
(
p_input
)
if
(
p_input
)
{
{
...
@@ -847,19 +846,6 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
...
@@ -847,19 +846,6 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
#undef INSERT_STRING
#undef INSERT_STRING
#undef INSERT_STRING_NO_FREE
#undef INSERT_STRING_NO_FREE
#undef str_format
/**
* Apply str format time and str format meta
*/
char
*
str_format
(
vlc_object_t
*
p_this
,
const
char
*
psz_src
)
{
char
*
psz_buf1
,
*
psz_buf2
;
psz_buf1
=
str_format_time
(
psz_src
);
psz_buf2
=
str_format_meta
(
p_this
,
psz_buf1
);
free
(
psz_buf1
);
return
psz_buf2
;
}
/**
/**
* Remove forbidden, potentially forbidden and otherwise evil characters from
* Remove forbidden, potentially forbidden and otherwise evil characters from
* filenames. This includes slashes, and popular characters like colon
* filenames. This includes slashes, and popular characters like colon
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment