Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
a18cf1de
Commit
a18cf1de
authored
Sep 27, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved clock master flag to es_out.
parent
5775fda6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
50 deletions
+27
-50
src/input/clock.c
src/input/clock.c
+21
-35
src/input/es_out.c
src/input/es_out.c
+1
-4
src/input/input.c
src/input/input.c
+0
-3
src/input/input_clock.h
src/input/input_clock.h
+5
-8
No files found.
src/input/clock.c
View file @
a18cf1de
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management
* input_clock.c: Clock/System date convertions, stream management
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2008 the VideoLAN team
* Copyright (C) 1999-2008 the VideoLAN team
* Copyright (C) 2008 Laurent Aimar
* $Id$
* $Id$
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
...
@@ -132,7 +133,6 @@ struct input_clock_t
...
@@ -132,7 +133,6 @@ struct input_clock_t
average_t
drift
;
average_t
drift
;
/* Current modifiers */
/* Current modifiers */
bool
b_master
;
int
i_rate
;
int
i_rate
;
};
};
...
@@ -142,7 +142,7 @@ static mtime_t ClockSystemToStream( input_clock_t *, mtime_t i_system );
...
@@ -142,7 +142,7 @@ static mtime_t ClockSystemToStream( input_clock_t *, mtime_t i_system );
/*****************************************************************************
/*****************************************************************************
* input_clock_New: create a new clock
* input_clock_New: create a new clock
*****************************************************************************/
*****************************************************************************/
input_clock_t
*
input_clock_New
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
)
input_clock_t
*
input_clock_New
(
int
i_cr_average
,
int
i_rate
)
{
{
input_clock_t
*
cl
=
malloc
(
sizeof
(
*
cl
)
);
input_clock_t
*
cl
=
malloc
(
sizeof
(
*
cl
)
);
if
(
!
cl
)
if
(
!
cl
)
...
@@ -158,7 +158,6 @@ input_clock_t *input_clock_New( bool b_master, int i_cr_average, int i_rate )
...
@@ -158,7 +158,6 @@ input_clock_t *input_clock_New( bool b_master, int i_cr_average, int i_rate )
cl
->
i_next_drift_update
=
0
;
cl
->
i_next_drift_update
=
0
;
AvgInit
(
&
cl
->
drift
,
i_cr_average
);
AvgInit
(
&
cl
->
drift
,
i_cr_average
);
cl
->
b_master
=
b_master
;
cl
->
i_rate
=
i_rate
;
cl
->
i_rate
=
i_rate
;
return
cl
;
return
cl
;
...
@@ -183,7 +182,6 @@ void input_clock_Update( input_clock_t *cl,
...
@@ -183,7 +182,6 @@ void input_clock_Update( input_clock_t *cl,
vlc_object_t
*
p_log
,
bool
b_can_pace_control
,
vlc_object_t
*
p_log
,
bool
b_can_pace_control
,
mtime_t
i_ck_stream
,
mtime_t
i_ck_system
)
mtime_t
i_ck_stream
,
mtime_t
i_ck_system
)
{
{
const
bool
b_synchronize
=
b_can_pace_control
&&
cl
->
b_master
;
bool
b_reset_reference
=
false
;
bool
b_reset_reference
=
false
;
if
(
(
!
cl
->
b_has_reference
)
||
if
(
(
!
cl
->
b_has_reference
)
||
...
@@ -217,7 +215,7 @@ void input_clock_Update( input_clock_t *cl,
...
@@ -217,7 +215,7 @@ void input_clock_Update( input_clock_t *cl,
__MAX
(
cl
->
i_ts_max
+
CR_MEAN_PTS_GAP
,
i_ck_system
)
);
__MAX
(
cl
->
i_ts_max
+
CR_MEAN_PTS_GAP
,
i_ck_system
)
);
}
}
if
(
!
b_
synchronize
&&
cl
->
i_next_drift_update
<
i_ck_system
)
if
(
!
b_
can_pace_control
&&
cl
->
i_next_drift_update
<
i_ck_system
)
{
{
const
mtime_t
i_converted
=
ClockSystemToStream
(
cl
,
i_ck_system
);
const
mtime_t
i_converted
=
ClockSystemToStream
(
cl
,
i_ck_system
);
...
@@ -238,25 +236,6 @@ void input_clock_Reset( input_clock_t *cl )
...
@@ -238,25 +236,6 @@ void input_clock_Reset( input_clock_t *cl )
cl
->
i_ts_max
=
0
;
cl
->
i_ts_max
=
0
;
}
}
/*****************************************************************************
* input_clock_GetTS: manages a PTS or DTS
*****************************************************************************/
mtime_t
input_clock_GetTS
(
input_clock_t
*
cl
,
mtime_t
i_pts_delay
,
mtime_t
i_ts
)
{
mtime_t
i_converted_ts
;
if
(
!
cl
->
b_has_reference
)
return
0
;
/* */
i_converted_ts
=
ClockStreamToSystem
(
cl
,
i_ts
+
AvgGet
(
&
cl
->
drift
)
);
if
(
i_converted_ts
>
cl
->
i_ts_max
)
cl
->
i_ts_max
=
i_converted_ts
;
return
i_converted_ts
+
i_pts_delay
;
}
/*****************************************************************************
/*****************************************************************************
* input_clock_ChangeRate:
* input_clock_ChangeRate:
*****************************************************************************/
*****************************************************************************/
...
@@ -269,14 +248,6 @@ void input_clock_ChangeRate( input_clock_t *cl, int i_rate )
...
@@ -269,14 +248,6 @@ void input_clock_ChangeRate( input_clock_t *cl, int i_rate )
cl
->
i_rate
=
i_rate
;
cl
->
i_rate
=
i_rate
;
}
}
/*****************************************************************************
* input_clock_ChangeMaster:
*****************************************************************************/
void
input_clock_ChangeMaster
(
input_clock_t
*
cl
,
bool
b_master
)
{
cl
->
b_master
=
b_master
;
}
/*****************************************************************************
/*****************************************************************************
* input_clock_GetWakeup
* input_clock_GetWakeup
*****************************************************************************/
*****************************************************************************/
...
@@ -286,12 +257,27 @@ mtime_t input_clock_GetWakeup( input_clock_t *cl )
...
@@ -286,12 +257,27 @@ mtime_t input_clock_GetWakeup( input_clock_t *cl )
if
(
!
cl
->
b_has_reference
)
if
(
!
cl
->
b_has_reference
)
return
0
;
return
0
;
/* We must not wait if we are not the master clock */
/* */
if
(
!
cl
->
b_master
)
return
ClockStreamToSystem
(
cl
,
cl
->
last
.
i_stream
);
}
/*****************************************************************************
* input_clock_GetTS: manages a PTS or DTS
*****************************************************************************/
mtime_t
input_clock_GetTS
(
input_clock_t
*
cl
,
mtime_t
i_pts_delay
,
mtime_t
i_ts
)
{
mtime_t
i_converted_ts
;
if
(
!
cl
->
b_has_reference
)
return
0
;
return
0
;
/* */
/* */
return
ClockStreamToSystem
(
cl
,
cl
->
last
.
i_stream
);
i_converted_ts
=
ClockStreamToSystem
(
cl
,
i_ts
+
AvgGet
(
&
cl
->
drift
)
);
if
(
i_converted_ts
>
cl
->
i_ts_max
)
cl
->
i_ts_max
=
i_converted_ts
;
return
i_converted_ts
+
i_pts_delay
;
}
}
/*****************************************************************************
/*****************************************************************************
...
...
src/input/es_out.c
View file @
a18cf1de
...
@@ -646,9 +646,6 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
...
@@ -646,9 +646,6 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
p_pgrm
->
b_selected
=
true
;
p_pgrm
->
b_selected
=
true
;
/* Switch master stream */
/* Switch master stream */
if
(
p_sys
->
p_pgrm
)
input_clock_ChangeMaster
(
p_sys
->
p_pgrm
->
p_clock
,
false
);
input_clock_ChangeMaster
(
p_pgrm
->
p_clock
,
true
);
p_sys
->
p_pgrm
=
p_pgrm
;
p_sys
->
p_pgrm
=
p_pgrm
;
/* Update "program" */
/* Update "program" */
...
@@ -697,7 +694,7 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, int i_group )
...
@@ -697,7 +694,7 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, int i_group )
p_pgrm
->
psz_now_playing
=
NULL
;
p_pgrm
->
psz_now_playing
=
NULL
;
p_pgrm
->
psz_publisher
=
NULL
;
p_pgrm
->
psz_publisher
=
NULL
;
p_pgrm
->
p_epg
=
NULL
;
p_pgrm
->
p_epg
=
NULL
;
p_pgrm
->
p_clock
=
input_clock_New
(
false
,
p_input
->
p
->
input
.
i_cr_average
,
p_sys
->
i_rate
);
p_pgrm
->
p_clock
=
input_clock_New
(
p_input
->
p
->
input
.
i_cr_average
,
p_sys
->
i_rate
);
if
(
!
p_pgrm
->
p_clock
)
if
(
!
p_pgrm
->
p_clock
)
{
{
free
(
p_pgrm
);
free
(
p_pgrm
);
...
...
src/input/input.c
View file @
a18cf1de
...
@@ -774,10 +774,7 @@ static void MainLoop( input_thread_t *p_input )
...
@@ -774,10 +774,7 @@ static void MainLoop( input_thread_t *p_input )
{
{
mtime_t
i_new_wakeup
=
input_EsOutGetWakeup
(
p_input
->
p
->
p_es_out
);
mtime_t
i_new_wakeup
=
input_EsOutGetWakeup
(
p_input
->
p
->
p_es_out
);
if
(
!
i_new_wakeup
)
if
(
!
i_new_wakeup
)
{
msg_Err
(
p_input
,
"RESET"
);
i_wakeup
=
0
;
i_wakeup
=
0
;
}
}
}
}
while
(
i_current
<
i_wakeup
);
}
while
(
i_current
<
i_wakeup
);
}
}
...
...
src/input/input_clock.h
View file @
a18cf1de
...
@@ -40,7 +40,7 @@ typedef struct input_clock_t input_clock_t;
...
@@ -40,7 +40,7 @@ typedef struct input_clock_t input_clock_t;
* This function creates a new input_clock_t.
* This function creates a new input_clock_t.
* You must use input_clock_Delete to delete it once unused.
* You must use input_clock_Delete to delete it once unused.
*/
*/
input_clock_t
*
input_clock_New
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
);
input_clock_t
*
input_clock_New
(
int
i_cr_average
,
int
i_rate
);
/**
/**
* This function destroys a input_clock_t created by input_clock_New.
* This function destroys a input_clock_t created by input_clock_New.
*/
*/
...
@@ -58,23 +58,20 @@ void input_clock_Update( input_clock_t *, vlc_object_t *p_log,
...
@@ -58,23 +58,20 @@ void input_clock_Update( input_clock_t *, vlc_object_t *p_log,
*/
*/
void
input_clock_Reset
(
input_clock_t
*
);
void
input_clock_Reset
(
input_clock_t
*
);
/**
* This function converts a timestamp from stream clock to system clock.
*/
mtime_t
input_clock_GetTS
(
input_clock_t
*
,
mtime_t
i_pts_delay
,
mtime_t
);
/**
/**
* This functions will return a deadline used to control the reading speed.
* This functions will return a deadline used to control the reading speed.
*/
*/
mtime_t
input_clock_GetWakeup
(
input_clock_t
*
cl
);
mtime_t
input_clock_GetWakeup
(
input_clock_t
*
cl
);
/**
/**
* This functions allows to change the actual reading speed.
* This functions allows to change the actual reading speed.
*/
*/
void
input_clock_ChangeRate
(
input_clock_t
*
cl
,
int
i_rate
);
void
input_clock_ChangeRate
(
input_clock_t
*
cl
,
int
i_rate
);
/**
/**
* This function allows to change the master status of a clock.
* This function converts a timestamp from stream clock to system clock.
* FIXME it should probably be moved out of input_clock_t.
*/
*/
void
input_clock_ChangeMaster
(
input_clock_t
*
cl
,
bool
b_master
);
mtime_t
input_clock_GetTS
(
input_clock_t
*
,
mtime_t
i_pts_delay
,
mtime_t
);
#endif
#endif
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