Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
e03ea0d7
Commit
e03ea0d7
authored
Dec 08, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed input_AddSubtitle(s) coherency.
parent
3de04848
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
24 deletions
+32
-24
include/vlc_input.h
include/vlc_input.h
+15
-3
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+1
-1
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+1
-1
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.cpp
+1
-1
src/control/video.c
src/control/video.c
+1
-1
src/input/control.c
src/input/control.c
+13
-0
src/input/input.c
src/input/input.c
+0
-16
src/libvlccore.sym
src/libvlccore.sym
+0
-1
No files found.
include/vlc_input.h
View file @
e03ea0d7
...
...
@@ -634,7 +634,8 @@ enum input_query_e
INPUT_GET_ATTACHMENT
,
/* arg1=input_attachment_t**, arg2=char* res=can fail */
/* On the fly input slave */
INPUT_ADD_SLAVE
,
/* arg1= char * */
INPUT_ADD_SLAVE
,
/* arg1= const char * */
INPUT_ADD_SUBTITLE
,
/* arg1= const char *, arg2=bool b_check_extension */
/* On the fly record while playing */
INPUT_SET_RECORD_STATE
,
/* arg1=bool res=can fail */
...
...
@@ -647,20 +648,31 @@ enum input_query_e
VLC_EXPORT
(
int
,
input_vaControl
,(
input_thread_t
*
,
int
i_query
,
va_list
)
);
VLC_EXPORT
(
int
,
input_Control
,
(
input_thread_t
*
,
int
i_query
,
...
)
);
/**
* It will return the current state of the input.
* Provided for convenience.
*/
static
inline
input_state_e
input_GetState
(
input_thread_t
*
p_input
)
{
input_state_e
state
=
INIT_S
;
input_Control
(
p_input
,
INPUT_GET_STATE
,
&
state
);
return
state
;
}
/**
* It will add a new subtitle source to the input.
* Provided for convenience.
*/
static
inline
int
input_AddSubtitle
(
input_thread_t
*
p_input
,
const
char
*
psz_url
,
bool
b_check_extension
)
{
return
input_Control
(
p_input
,
INPUT_ADD_SUBTITLE
,
psz_url
,
b_check_extension
);
}
/* */
typedef
struct
input_clock_t
input_clock_t
;
VLC_EXPORT
(
decoder_t
*
,
input_DecoderNew
,
(
input_thread_t
*
,
es_format_t
*
,
input_clock_t
*
,
sout_instance_t
*
)
);
VLC_EXPORT
(
void
,
input_DecoderDelete
,
(
decoder_t
*
)
);
VLC_EXPORT
(
void
,
input_DecoderDecode
,(
decoder_t
*
,
block_t
*
)
);
VLC_EXPORT
(
bool
,
input_AddSubtitles
,
(
input_thread_t
*
,
char
*
,
bool
)
);
VLC_EXPORT
(
vlc_event_manager_t
*
,
input_get_event_manager
,
(
input_thread_t
*
)
);
/**
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
e03ea0d7
...
...
@@ -592,7 +592,7 @@ void DialogsProvider::loadSubtitlesFile()
QString
qsFile
;
foreach
(
qsFile
,
qsl
)
{
if
(
!
input_AddSubtitles
(
p_input
,
qtu
(
toNativeSeparators
(
qsFile
)
),
if
(
input_AddSubtitle
(
p_input
,
qtu
(
toNativeSeparators
(
qsFile
)
),
true
)
)
msg_Warn
(
p_intf
,
"unable to load subtitles from '%s'"
,
qtu
(
qsFile
)
);
...
...
modules/gui/qt4/main_interface.cpp
View file @
e03ea0d7
...
...
@@ -1035,7 +1035,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
{
if
(
THEMIM
->
getIM
()
->
hasInput
()
)
{
if
(
input_AddSubtitles
(
THEMIM
->
getInput
(),
if
(
!
input_AddSubtitle
(
THEMIM
->
getInput
(),
qtu
(
toNativeSeparators
(
mimeData
->
urls
()[
0
].
toLocalFile
()
)
),
true
)
)
...
...
modules/gui/wxwidgets/interface.cpp
View file @
e03ea0d7
...
...
@@ -1329,7 +1329,7 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
p_input
)
{
if
(
input_AddSubtitles
(
p_input
,
psz_utf8
,
true
)
)
if
(
!
input_AddSubtitle
(
p_input
,
psz_utf8
,
true
)
)
{
vlc_object_release
(
p_input
);
wxDnDLocaleFree
(
psz_utf8
);
...
...
src/control/video.c
View file @
e03ea0d7
...
...
@@ -440,7 +440,7 @@ int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi,
if
(
p_input_thread
)
{
if
(
input_AddSubtitles
(
p_input_thread
,
psz_subtitle
,
true
)
)
if
(
!
input_AddSubtitle
(
p_input_thread
,
psz_subtitle
,
true
)
)
b_ret
=
true
;
vlc_object_release
(
p_input_thread
);
}
...
...
src/input/control.c
View file @
e03ea0d7
...
...
@@ -340,6 +340,19 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
}
return
VLC_SUCCESS
;
case
INPUT_ADD_SUBTITLE
:
psz
=
(
char
*
)
va_arg
(
args
,
char
*
);
b_bool
=
(
bool
)
va_arg
(
args
,
int
);
if
(
!
psz
||
*
psz
==
'\0'
)
return
VLC_EGENERIC
;
if
(
b_bool
&&
!
subtitles_Filter
(
psz
)
)
return
VLC_EGENERIC
;
val
.
psz_string
=
strdup
(
psz
);
input_ControlPush
(
p_input
,
INPUT_CONTROL_ADD_SUBTITLE
,
&
val
);
return
VLC_SUCCESS
;
case
INPUT_GET_ATTACHMENTS
:
/* arg1=input_attachment_t***, arg2=int* res=can fail */
{
input_attachment_t
***
ppp_attachment
=
(
input_attachment_t
***
)
va_arg
(
args
,
input_attachment_t
***
);
...
...
src/input/input.c
View file @
e03ea0d7
...
...
@@ -3159,22 +3159,6 @@ static void SubtitleAdd( input_thread_t *p_input, char *psz_subtitle, bool b_for
}
}
bool
input_AddSubtitles
(
input_thread_t
*
p_input
,
char
*
psz_subtitle
,
bool
b_check_extension
)
{
vlc_value_t
val
;
if
(
b_check_extension
&&
!
subtitles_Filter
(
psz_subtitle
)
)
return
false
;
assert
(
psz_subtitle
!=
NULL
);
val
.
psz_string
=
strdup
(
psz_subtitle
);
if
(
val
.
psz_string
)
input_ControlPush
(
p_input
,
INPUT_CONTROL_ADD_SUBTITLE
,
&
val
);
return
true
;
}
/*****************************************************************************
* Statistics
*****************************************************************************/
...
...
src/libvlccore.sym
View file @
e03ea0d7
...
...
@@ -154,7 +154,6 @@ httpd_UrlNewUnique
__image_HandlerCreate
image_HandlerDelete
InitMD5
input_AddSubtitles
input_Control
__input_CreateThread
input_DecoderDecode
...
...
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