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
768bd8a4
Commit
768bd8a4
authored
May 11, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split INPUT_EVENT_TIMES into INPUT_EVENT_POSITION/LENGTH.
It allows a finer control on what to update (for gui).
parent
6701b274
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
22 deletions
+41
-22
include/vlc_input.h
include/vlc_input.h
+5
-2
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+2
-1
src/control/media_player.c
src/control/media_player.c
+1
-1
src/input/es_out.c
src/input/es_out.c
+15
-11
src/input/event.c
src/input/event.c
+13
-5
src/input/event.h
src/input/event.h
+2
-1
src/input/input.c
src/input/input.c
+3
-1
No files found.
include/vlc_input.h
View file @
768bd8a4
...
...
@@ -383,8 +383,11 @@ typedef enum input_event_type_e
/* "rate" has changed */
INPUT_EVENT_RATE
,
/* At least one of "position" or "time" or "length" has changed */
INPUT_EVENT_TIMES
,
/* At least one of "position" or "time" */
INPUT_EVENT_POSITION
,
/* "length" has changed */
INPUT_EVENT_LENGTH
,
/* A title has been added or removed or selected.
* It imply that chapter has changed (not chapter event is sent) */
...
...
modules/gui/qt4/input_manager.cpp
View file @
768bd8a4
...
...
@@ -275,7 +275,8 @@ static int InputEvent( vlc_object_t *p_this, const char *,
case
INPUT_EVENT_RATE
:
event
=
new
IMEvent
(
ItemRateChanged_Type
,
0
);
break
;
case
INPUT_EVENT_TIMES
:
case
INPUT_EVENT_POSITION
:
//case INPUT_EVENT_LENGTH:
event
=
new
IMEvent
(
PositionUpdate_Type
,
0
);
break
;
...
...
src/control/media_player.c
View file @
768bd8a4
...
...
@@ -219,7 +219,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
libvlc_media_set_state
(
p_mi
->
p_md
,
libvlc_state
,
NULL
);
libvlc_event_send
(
p_mi
->
p_event_manager
,
&
event
);
}
else
if
(
newval
.
i_int
==
INPUT_EVENT_
TIMES
)
else
if
(
newval
.
i_int
==
INPUT_EVENT_
POSITION
)
{
if
(
var_GetInteger
(
p_input
,
"state"
)
!=
PLAYING_S
)
return
VLC_SUCCESS
;
/* Don't send the position while stopped */
...
...
src/input/es_out.c
View file @
768bd8a4
...
...
@@ -2445,20 +2445,24 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
mtime_t
i_time
=
(
mtime_t
)
va_arg
(
args
,
mtime_t
);
mtime_t
i_length
=
(
mtime_t
)
va_arg
(
args
,
mtime_t
);
/* Fix for buffering delay */
const
mtime_t
i_delay
=
EsOutGetBuffering
(
out
);
input_SendEventLength
(
p_sys
->
p_input
,
i_length
);
i_time
-=
i_delay
;
if
(
i_time
<
0
)
i_time
=
0
;
if
(
!
p_sys
->
b_buffering
)
{
/* Fix for buffering delay */
const
mtime_t
i_delay
=
EsOutGetBuffering
(
out
);
if
(
i_length
>
0
)
f_position
-=
(
double
)
i_delay
/
i_length
;
if
(
f_position
<
0
)
f_position
=
0
;
i_time
-=
i_delay
;
if
(
i_time
<
0
)
i_time
=
0
;
if
(
!
p_sys
->
b_buffering
)
input_SendEventTimes
(
p_sys
->
p_input
,
f_position
,
i_time
,
i_length
);
if
(
i_length
>
0
)
f_position
-=
(
double
)
i_delay
/
i_length
;
if
(
f_position
<
0
)
f_position
=
0
;
input_SendEventPosition
(
p_sys
->
p_input
,
f_position
,
i_time
);
}
return
VLC_SUCCESS
;
}
case
ES_OUT_SET_JITTER
:
...
...
src/input/event.c
View file @
768bd8a4
...
...
@@ -60,8 +60,7 @@ void input_SendEventAbort( input_thread_t *p_input )
Trigger
(
p_input
,
INPUT_EVENT_ABORT
);
}
void
input_SendEventTimes
(
input_thread_t
*
p_input
,
double
f_position
,
mtime_t
i_time
,
mtime_t
i_length
)
void
input_SendEventPosition
(
input_thread_t
*
p_input
,
double
f_position
,
mtime_t
i_time
)
{
vlc_value_t
val
;
...
...
@@ -73,13 +72,22 @@ void input_SendEventTimes( input_thread_t *p_input,
val
.
i_time
=
i_time
;
var_Change
(
p_input
,
"time"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_POSITION
);
}
void
input_SendEventLength
(
input_thread_t
*
p_input
,
mtime_t
i_length
)
{
vlc_value_t
val
;
/* FIXME ugly + what about meta change event ? */
if
(
var_GetTime
(
p_input
,
"length"
)
!=
i_length
)
input_item_SetDuration
(
p_input
->
p
->
p_item
,
i_length
);
if
(
var_GetTime
(
p_input
,
"length"
)
==
i_length
)
return
;
input_item_SetDuration
(
p_input
->
p
->
p_item
,
i_length
);
val
.
i_time
=
i_length
;
var_Change
(
p_input
,
"length"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_
TIMES
);
Trigger
(
p_input
,
INPUT_EVENT_
LENGTH
);
}
void
input_SendEventStatistics
(
input_thread_t
*
p_input
)
{
...
...
src/input/event.h
View file @
768bd8a4
...
...
@@ -35,7 +35,8 @@
*****************************************************************************/
void
input_SendEventDead
(
input_thread_t
*
p_input
);
void
input_SendEventAbort
(
input_thread_t
*
p_input
);
void
input_SendEventTimes
(
input_thread_t
*
p_input
,
double
f_position
,
mtime_t
i_time
,
mtime_t
i_length
);
void
input_SendEventPosition
(
input_thread_t
*
p_input
,
double
f_position
,
mtime_t
i_time
);
void
input_SendEventLength
(
input_thread_t
*
p_input
,
mtime_t
i_length
);
void
input_SendEventStatistics
(
input_thread_t
*
p_input
);
void
input_SendEventRate
(
input_thread_t
*
p_input
,
int
i_rate
);
void
input_SendEventAudioDelay
(
input_thread_t
*
p_input
,
mtime_t
i_delay
);
...
...
src/input/input.c
View file @
768bd8a4
...
...
@@ -1205,7 +1205,9 @@ static int Init( input_thread_t * p_input )
i_length
=
0
;
if
(
i_length
<=
0
)
i_length
=
input_item_GetDuration
(
p_input
->
p
->
p_item
);
input_SendEventTimes
(
p_input
,
0
.
0
,
0
,
i_length
);
input_SendEventLength
(
p_input
,
i_length
);
input_SendEventPosition
(
p_input
,
0
.
0
,
0
);
if
(
!
p_input
->
b_preparsing
)
{
...
...
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