Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
2190e615
Commit
2190e615
authored
Apr 17, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: factor INPUT_CONTROL_SET_SEEKPOINT code
parent
a87b4b35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
59 deletions
+37
-59
src/input/input.c
src/input/input.c
+37
-59
No files found.
src/input/input.c
View file @
2190e615
...
@@ -1927,60 +1927,35 @@ static bool Control( input_thread_t *p_input,
...
@@ -1927,60 +1927,35 @@ static bool Control( input_thread_t *p_input,
case
INPUT_CONTROL_SET_SEEKPOINT
:
case
INPUT_CONTROL_SET_SEEKPOINT
:
case
INPUT_CONTROL_SET_SEEKPOINT_NEXT
:
case
INPUT_CONTROL_SET_SEEKPOINT_NEXT
:
case
INPUT_CONTROL_SET_SEEKPOINT_PREV
:
case
INPUT_CONTROL_SET_SEEKPOINT_PREV
:
{
if
(
p_input
->
p
->
b_recording
)
if
(
p_input
->
p
->
b_recording
)
{
{
msg_Err
(
p_input
,
"INPUT_CONTROL_SET_SEEKPOINT(*) ignored while recording"
);
msg_Err
(
p_input
,
"INPUT_CONTROL_SET_SEEKPOINT(*) ignored while recording"
);
break
;
break
;
}
}
if
(
p_input
->
p
->
input
.
i_title
<=
0
)
break
;
i
f
(
p_input
->
p
->
input
.
b_title_demux
&&
i
nt
i_title
,
i_seekpoint
;
p_input
->
p
->
input
.
i_title
>
0
)
if
(
p_input
->
p
->
input
.
b_title_demux
)
{
{
demux_t
*
p_demux
=
p_input
->
p
->
input
.
p_demux
;
demux_t
*
p_demux
=
p_input
->
p
->
input
.
p_demux
;
int
i_seekpoint
;
int64_t
i_input_time
;
int64_t
i_seekpoint_time
;
if
(
i_type
==
INPUT_CONTROL_SET_SEEKPOINT_PREV
)
i_title
=
p_demux
->
info
.
i_title
;
{
i_seekpoint
=
p_demux
->
info
.
i_seekpoint
;
i_seekpoint
=
p_demux
->
info
.
i_seekpoint
;
i_seekpoint_time
=
p_input
->
p
->
input
.
title
[
p_demux
->
info
.
i_title
]
->
seekpoint
[
i_seekpoint
]
->
i_time_offset
;
i_input_time
=
var_GetTime
(
p_input
,
"time"
);
if
(
i_seekpoint_time
>=
0
&&
i_input_time
>=
0
)
{
if
(
i_input_time
<
i_seekpoint_time
+
3000000
)
i_seekpoint
--
;
}
else
i_seekpoint
--
;
}
}
else
if
(
i_type
==
INPUT_CONTROL_SET_SEEKPOINT_NEXT
)
i_seekpoint
=
p_demux
->
info
.
i_seekpoint
+
1
;
else
else
i_seekpoint
=
val
.
i_int
;
if
(
i_seekpoint
>=
0
&&
i_seekpoint
<
p_input
->
p
->
input
.
title
[
p_demux
->
info
.
i_title
]
->
i_seekpoint
)
{
{
access_t
*
p_access
=
p_input
->
p
->
input
.
p_access
;
es_out_SetTime
(
p_input
->
p
->
p_es_out
,
-
1
);
i_title
=
p_access
->
info
.
i_title
;
i_seekpoint
=
p_access
->
info
.
i_seekpoint
;
demux_Control
(
p_demux
,
DEMUX_SET_SEEKPOINT
,
i_seekpoint
);
input_SendEventSeekpoint
(
p_input
,
p_demux
->
info
.
i_title
,
i_seekpoint
);
}
}
}
else
if
(
p_input
->
p
->
input
.
i_title
>
0
)
{
access_t
*
p_access
=
p_input
->
p
->
input
.
p_access
;
int
i_seekpoint
;
int64_t
i_input_time
;
int64_t
i_seekpoint_time
;
if
(
i_type
==
INPUT_CONTROL_SET_SEEKPOINT_PREV
)
if
(
i_type
==
INPUT_CONTROL_SET_SEEKPOINT_PREV
)
{
{
i_seekpoint
=
p_access
->
info
.
i_seekpoint
;
int64_t
i_seekpoint_time
=
p_input
->
p
->
input
.
title
[
i_title
]
->
seekpoint
[
i_seekpoint
]
->
i_time_offset
;
i_seekpoint_time
=
p_input
->
p
->
input
.
title
[
p_access
->
info
.
i_title
]
->
seekpoint
[
i_seekpoint
]
->
i_time_offset
;
int64_t
i_input_time
=
var_GetTime
(
p_input
,
"time"
);
i_input_time
=
var_GetTime
(
p_input
,
"time"
);
if
(
i_seekpoint_time
>=
0
&&
i_input_time
>=
0
)
if
(
i_seekpoint_time
>=
0
&&
i_input_time
>=
0
)
{
{
if
(
i_input_time
<
i_seekpoint_time
+
3000000
)
if
(
i_input_time
<
i_seekpoint_time
+
3000000
)
...
@@ -1990,21 +1965,24 @@ static bool Control( input_thread_t *p_input,
...
@@ -1990,21 +1965,24 @@ static bool Control( input_thread_t *p_input,
i_seekpoint
--
;
i_seekpoint
--
;
}
}
else
if
(
i_type
==
INPUT_CONTROL_SET_SEEKPOINT_NEXT
)
else
if
(
i_type
==
INPUT_CONTROL_SET_SEEKPOINT_NEXT
)
i_seekpoint
=
p_access
->
info
.
i_seekpoint
+
1
;
i_seekpoint
++
;
else
else
i_seekpoint
=
val
.
i_int
;
i_seekpoint
=
val
.
i_int
;
if
(
i_seekpoint
<
0
||
i_seekpoint
>=
p_input
->
p
->
input
.
title
[
i_title
]
->
i_seekpoint
)
break
;
if
(
i_seekpoint
>=
0
&&
i_seekpoint
<
p_input
->
p
->
input
.
title
[
p_access
->
info
.
i_title
]
->
i_seekpoint
)
{
es_out_SetTime
(
p_input
->
p
->
p_es_out
,
-
1
);
es_out_SetTime
(
p_input
->
p
->
p_es_out
,
-
1
);
if
(
p_input
->
p
->
input
.
b_title_demux
)
stream_Control
(
p_input
->
p
->
input
.
p_stream
,
STREAM_CONTROL_ACCESS
,
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_SET_SEEKPOINT
,
i_seekpoint
);
else
stream_Control
(
p_input
->
p
->
input
.
p_stream
,
STREAM_CONTROL_ACCESS
,
ACCESS_SET_SEEKPOINT
,
i_seekpoint
);
ACCESS_SET_SEEKPOINT
,
i_seekpoint
);
input_SendEventSeekpoint
(
p_input
,
p_access
->
info
.
i_title
,
i_seekpoint
);
input_SendEventSeekpoint
(
p_input
,
i_title
,
i_seekpoint
);
}
}
break
;
break
;
}
case
INPUT_CONTROL_ADD_SUBTITLE
:
case
INPUT_CONTROL_ADD_SUBTITLE
:
if
(
val
.
psz_string
)
if
(
val
.
psz_string
)
...
...
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