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
68bc7fd9
Commit
68bc7fd9
authored
Jan 01, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
str_format_meta: take input thread pointer rather than playlist
parent
098f3844
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
16 deletions
+22
-16
include/vlc_strings.h
include/vlc_strings.h
+3
-3
modules/gui/macosx/CoreInteraction.m
modules/gui/macosx/CoreInteraction.m
+1
-1
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+1
-1
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+1
-1
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+1
-1
src/input/input.c
src/input/input.c
+4
-3
src/text/strings.c
src/text/strings.c
+11
-6
No files found.
include/vlc_strings.h
View file @
68bc7fd9
...
...
@@ -45,12 +45,12 @@ 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
*
str_format_time
(
const
char
*
);
VLC_API
char
*
str_format_meta
(
playlist
_t
*
,
const
char
*
);
VLC_API
char
*
str_format_meta
(
input_thread
_t
*
,
const
char
*
);
static
inline
char
*
str_format
(
playlist_t
*
pl
,
const
char
*
fmt
)
static
inline
char
*
str_format
(
input_thread_t
*
input
,
const
char
*
fmt
)
{
char
*
s1
=
str_format_time
(
fmt
);
char
*
s2
=
str_format_meta
(
pl
,
s1
);
char
*
s2
=
str_format_meta
(
input
,
s1
);
free
(
s1
);
return
s2
;
}
...
...
modules/gui/macosx/CoreInteraction.m
View file @
68bc7fd9
...
...
@@ -270,7 +270,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
NSString
*
o_name
;
char
*
format
=
var_InheritString
(
VLCIntf
,
"input-title-format"
);
char
*
formated
=
str_format_meta
(
p
l_Get
(
VLCIntf
)
,
format
);
char
*
formated
=
str_format_meta
(
p
_input
,
format
);
free
(
format
);
o_name
=
[
NSString
stringWithUTF8String
:
formated
];
free
(
formated
);
...
...
modules/gui/macosx/MainWindow.m
View file @
68bc7fd9
...
...
@@ -663,7 +663,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if
(
!
config_GetPsz
(
VLCIntf
,
"video-title"
))
{
char
*
format
=
var_InheritString
(
VLCIntf
,
"input-title-format"
);
char
*
formated
=
str_format_meta
(
p
l_Get
(
VLCIntf
)
,
format
);
char
*
formated
=
str_format_meta
(
p
_input
,
format
);
free
(
format
);
aString
=
[
NSString
stringWithUTF8String
:
formated
];
free
(
formated
);
...
...
modules/gui/qt4/input_manager.cpp
View file @
68bc7fd9
...
...
@@ -468,7 +468,7 @@ void InputManager::UpdateName()
/* Try to get the nowplaying */
char
*
format
=
var_InheritString
(
p_intf
,
"input-title-format"
);
char
*
formated
=
str_format_meta
(
THEPL
,
format
);
char
*
formated
=
str_format_meta
(
p_input
,
format
);
free
(
format
);
name
=
qfu
(
formated
);
free
(
formated
);
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
68bc7fd9
...
...
@@ -739,7 +739,7 @@ void VlcProc::update_current_input()
{
// Update short name (as defined by --input-title-format)
char
*
psz_fmt
=
var_InheritString
(
getIntf
(),
"input-title-format"
);
char
*
psz_name
=
str_format_meta
(
p
Playlis
t
,
psz_fmt
);
char
*
psz_name
=
str_format_meta
(
p
Inpu
t
,
psz_fmt
);
SET_TEXT
(
m_cVarStreamName
,
UString
(
getIntf
(),
psz_name
)
);
free
(
psz_fmt
);
free
(
psz_name
);
...
...
src/input/input.c
View file @
68bc7fd9
...
...
@@ -3105,6 +3105,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
)
{
playlist_t
*
pl
=
pl_Get
(
p_obj
);
input_thread_t
*
input
=
playlist_CurrentInput
(
pl
);
char
*
psz_file
;
DIR
*
path
;
...
...
@@ -3113,7 +3115,7 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
{
closedir
(
path
);
char
*
psz_tmp
=
str_format
(
pl_Get
(
p_obj
)
,
psz_prefix
);
char
*
psz_tmp
=
str_format
(
input
,
psz_prefix
);
if
(
!
psz_tmp
)
return
NULL
;
...
...
@@ -3129,9 +3131,8 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
}
else
{
psz_file
=
str_format
(
pl_Get
(
p_obj
)
,
psz_path
);
psz_file
=
str_format
(
input
,
psz_path
);
path_sanitize
(
psz_file
);
return
psz_file
;
}
}
src/text/strings.c
View file @
68bc7fd9
...
...
@@ -42,7 +42,7 @@
/* Needed by str_format_meta */
#include <vlc_input.h>
#include <vlc_meta.h>
#include <vlc_
playlis
t.h>
#include <vlc_
aou
t.h>
#include <vlc_strings.h>
#include <vlc_charset.h>
...
...
@@ -526,13 +526,12 @@ static void format_duration (char *buf, size_t len, int64_t duration)
memcpy( dst+d, string, len ); \
d += len; \
}
char
*
str_format_meta
(
playlist_t
*
p_playlis
t
,
const
char
*
s
)
char
*
str_format_meta
(
input_thread_t
*
p_inpu
t
,
const
char
*
s
)
{
char
*
dst
=
strdup
(
s
);
if
(
unlikely
(
dst
==
NULL
)
)
return
NULL
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
input_item_t
*
p_item
=
p_input
?
input_GetItem
(
p_input
)
:
NULL
;
size_t
i_size
=
strlen
(
s
)
+
1
;
/* +1 to store '\0' */
size_t
d
=
0
;
...
...
@@ -730,11 +729,17 @@ char *str_format_meta( playlist_t *p_playlist, const char *s )
break
;
case
'V'
:
{
float
vol
=
playlist_VolumeGet
(
p_object
);
float
vol
=
0
.
f
;
if
(
p_input
)
{
audio_output_t
*
aout
=
input_GetAout
(
p_input
);
if
(
aout
)
vol
=
aout_VolumeGet
(
aout
);
}
if
(
vol
>=
0
.
f
)
{
snprintf
(
buf
,
10
,
"%ld"
,
lroundf
(
vol
*
AOUT_VOLUME_DEFAULT
)
);
snprintf
(
buf
,
10
,
"%ld"
,
lroundf
(
vol
*
256
.
f
)
);
INSERT_STRING_NO_FREE
(
buf
);
}
else
...
...
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