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
e712c11f
Commit
e712c11f
authored
Feb 19, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: rectify SPU track IDs (refs #7645)
parent
22408026
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
32 deletions
+11
-32
lib/video.c
lib/video.c
+11
-32
No files found.
lib/video.c
View file @
e712c11f
...
...
@@ -283,11 +283,6 @@ void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi,
int
libvlc_video_get_spu
(
libvlc_media_player_t
*
p_mi
)
{
input_thread_t
*
p_input_thread
=
libvlc_get_input_thread
(
p_mi
);
vlc_value_t
val_list
;
vlc_value_t
val
;
int
i_spu
=
-
1
;
int
i_ret
=
-
1
;
int
i
;
if
(
!
p_input_thread
)
{
...
...
@@ -295,24 +290,7 @@ int libvlc_video_get_spu( libvlc_media_player_t *p_mi )
return
-
1
;
}
i_ret
=
var_Get
(
p_input_thread
,
"spu-es"
,
&
val
);
if
(
i_ret
<
0
)
{
vlc_object_release
(
p_input_thread
);
libvlc_printerr
(
"Subtitle information not found"
);
return
-
1
;
}
var_Change
(
p_input_thread
,
"spu-es"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
for
(
i
=
0
;
i
<
val_list
.
p_list
->
i_count
;
i
++
)
{
if
(
val
.
i_int
==
val_list
.
p_list
->
p_values
[
i
].
i_int
)
{
i_spu
=
i
;
break
;
}
}
var_FreeList
(
&
val_list
,
NULL
);
int
i_spu
=
var_GetInteger
(
p_input_thread
,
"spu-es"
);
vlc_object_release
(
p_input_thread
);
return
i_spu
;
}
...
...
@@ -340,22 +318,23 @@ int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu )
{
input_thread_t
*
p_input_thread
=
libvlc_get_input_thread
(
p_mi
);
vlc_value_t
list
;
int
i_ret
=
0
;
int
i_ret
=
-
1
;
if
(
!
p_input_thread
)
return
-
1
;
var_Change
(
p_input_thread
,
"spu-es"
,
VLC_VAR_GETCHOICES
,
&
list
,
NULL
);
if
(
i_spu
>
(
unsigned
)
list
.
p_list
->
i_count
)
for
(
int
i
=
0
;
i
<
list
.
p_list
->
i_count
;
i
++
)
{
libvlc_printerr
(
"Subtitle number out of range (%u/%u)"
,
i_spu
,
list
.
p_list
->
i_count
);
i_ret
=
-
1
;
goto
end
;
if
(
i_spu
==
list
.
p_list
->
p_values
[
i
].
i_int
)
{
if
(
var_SetInteger
(
p_input_thread
,
"spu-es"
,
i_spu
)
<
0
)
break
;
i_ret
=
0
;
goto
end
;
}
}
var_SetInteger
(
p_input_thread
,
"spu-es"
,
list
.
p_list
->
p_values
[
i_spu
].
i_int
);
libvlc_printerr
(
"Track identifier not found"
);
end:
vlc_object_release
(
p_input_thread
);
var_FreeList
(
&
list
,
NULL
);
...
...
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