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
da5a30e4
Commit
da5a30e4
authored
Sep 24, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No functionnal changes.
It fixes clock prototypes.
parent
03b02bd6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
43 deletions
+43
-43
src/input/clock.c
src/input/clock.c
+19
-19
src/input/es_out.c
src/input/es_out.c
+15
-15
src/input/input_internal.h
src/input/input_internal.h
+9
-9
No files found.
src/input/clock.c
View file @
da5a30e4
...
...
@@ -137,9 +137,9 @@ static void ClockNewRef( input_clock_t *cl,
}
/*****************************************************************************
* 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
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
)
{
input_clock_t
*
cl
=
malloc
(
sizeof
(
*
cl
)
);
if
(
!
cl
)
...
...
@@ -164,21 +164,21 @@ input_clock_t *input_ClockNew( bool b_master, int i_cr_average, int i_rate )
}
/*****************************************************************************
* input_
Clock
Delete: destroy a new clock
* input_
clock_
Delete: destroy a new clock
*****************************************************************************/
void
input_
Clock
Delete
(
input_clock_t
*
cl
)
void
input_
clock_
Delete
(
input_clock_t
*
cl
)
{
free
(
cl
);
}
/*****************************************************************************
* input_
Clock
SetPCR: manages a clock reference
* input_
clock_
SetPCR: manages a clock reference
*
* i_ck_stream: date in stream clock
* i_ck_system: date in system clock
*****************************************************************************/
void
input_
ClockSetPCR
(
input_thread_t
*
p_input
,
input_clock_t
*
cl
,
void
input_
clock_SetPCR
(
input_clock_t
*
cl
,
input_thread_t
*
p_input
,
mtime_t
i_ck_stream
,
mtime_t
i_ck_system
)
{
const
bool
b_synchronize
=
p_input
->
b_can_pace_control
&&
cl
->
b_master
;
...
...
@@ -236,19 +236,19 @@ void input_ClockSetPCR( input_thread_t *p_input,
}
/*****************************************************************************
* input_
Clock
ResetPCR:
* input_
clock_
ResetPCR:
*****************************************************************************/
void
input_
Clock
ResetPCR
(
input_clock_t
*
cl
)
void
input_
clock_
ResetPCR
(
input_clock_t
*
cl
)
{
cl
->
b_has_reference
=
false
;
cl
->
last_pts
=
0
;
}
/*****************************************************************************
* input_
Clock
GetTS: manages a PTS or DTS
* input_
clock_
GetTS: manages a PTS or DTS
*****************************************************************************/
mtime_t
input_
ClockGetTS
(
input_thread_t
*
p_input
,
input_clock_t
*
cl
,
mtime_t
i_ts
)
mtime_t
input_
clock_GetTS
(
input_clock_t
*
cl
,
input_thread_t
*
p_input
,
mtime_t
i_ts
)
{
if
(
!
cl
->
b_has_reference
)
return
0
;
...
...
@@ -258,9 +258,9 @@ mtime_t input_ClockGetTS( input_thread_t * p_input,
}
/*****************************************************************************
* input_
Clock
SetRate:
* input_
clock_
SetRate:
*****************************************************************************/
void
input_
Clock
SetRate
(
input_clock_t
*
cl
,
int
i_rate
)
void
input_
clock_
SetRate
(
input_clock_t
*
cl
,
int
i_rate
)
{
/* Move the reference point */
if
(
cl
->
b_has_reference
)
...
...
@@ -270,17 +270,17 @@ void input_ClockSetRate( input_clock_t *cl, int i_rate )
}
/*****************************************************************************
* input_
Clock
SetMaster:
* input_
clock_
SetMaster:
*****************************************************************************/
void
input_
Clock
SetMaster
(
input_clock_t
*
cl
,
bool
b_master
)
void
input_
clock_
SetMaster
(
input_clock_t
*
cl
,
bool
b_master
)
{
cl
->
b_master
=
b_master
;
}
/*****************************************************************************
* input_
Clock
GetWakeup
* input_
clock_
GetWakeup
*****************************************************************************/
mtime_t
input_
ClockGetWakeup
(
input_thread_t
*
p_input
,
input_clock_t
*
cl
)
mtime_t
input_
clock_GetWakeup
(
input_clock_t
*
cl
,
input_thread_t
*
p_input
)
{
/* Not synchronized, we cannot wait */
if
(
!
cl
->
b_has_reference
)
...
...
src/input/es_out.c
View file @
da5a30e4
...
...
@@ -317,7 +317,7 @@ void input_EsOutDelete( es_out_t *out )
for
(
i
=
0
;
i
<
p_sys
->
i_pgrm
;
i
++
)
{
es_out_pgrm_t
*
p_pgrm
=
p_sys
->
pgrm
[
i
];
input_
Clock
Delete
(
p_pgrm
->
p_clock
);
input_
clock_
Delete
(
p_pgrm
->
p_clock
);
free
(
p_pgrm
->
psz_now_playing
);
free
(
p_pgrm
->
psz_publisher
);
free
(
p_pgrm
->
psz_name
);
...
...
@@ -355,7 +355,7 @@ mtime_t input_EsOutGetWakeup( es_out_t *out )
if
(
!
p_sys
->
p_pgrm
)
return
0
;
return
input_
ClockGetWakeup
(
p_sys
->
p_input
,
p_sys
->
p_pgrm
->
p_clock
);
return
input_
clock_GetWakeup
(
p_sys
->
p_pgrm
->
p_clock
,
p_sys
->
p_input
);
}
static
void
EsOutDiscontinuity
(
es_out_t
*
out
,
bool
b_flush
,
bool
b_audio
)
...
...
@@ -386,7 +386,7 @@ void input_EsOutChangeRate( es_out_t *out, int i_rate )
EsOutDiscontinuity
(
out
,
false
,
false
);
for
(
i
=
0
;
i
<
p_sys
->
i_pgrm
;
i
++
)
input_
Clock
SetRate
(
p_sys
->
pgrm
[
i
]
->
p_clock
,
i_rate
);
input_
clock_
SetRate
(
p_sys
->
pgrm
[
i
]
->
p_clock
,
i_rate
);
}
int
input_EsOutSetRecord
(
es_out_t
*
out
,
bool
b_record
)
...
...
@@ -640,8 +640,8 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
/* Switch master stream */
if
(
p_sys
->
p_pgrm
)
input_
Clock
SetMaster
(
p_sys
->
p_pgrm
->
p_clock
,
false
);
input_
Clock
SetMaster
(
p_pgrm
->
p_clock
,
true
);
input_
clock_
SetMaster
(
p_sys
->
p_pgrm
->
p_clock
,
false
);
input_
clock_
SetMaster
(
p_pgrm
->
p_clock
,
true
);
p_sys
->
p_pgrm
=
p_pgrm
;
/* Update "program" */
...
...
@@ -690,7 +690,7 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, int i_group )
p_pgrm
->
psz_now_playing
=
NULL
;
p_pgrm
->
psz_publisher
=
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
(
false
,
p_input
->
p
->
input
.
i_cr_average
,
p_sys
->
i_rate
);
if
(
!
p_pgrm
->
p_clock
)
{
free
(
p_pgrm
);
...
...
@@ -751,7 +751,7 @@ static int EsOutProgramDel( es_out_t *out, int i_group )
if
(
p_sys
->
p_pgrm
==
p_pgrm
)
p_sys
->
p_pgrm
=
NULL
;
input_
Clock
Delete
(
p_pgrm
->
p_clock
);
input_
clock_
Delete
(
p_pgrm
->
p_clock
);
free
(
p_pgrm
->
psz_name
);
free
(
p_pgrm
->
psz_now_playing
);
...
...
@@ -1546,7 +1546,7 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
else
if
(
p_block
->
i_dts
>
0
)
{
p_block
->
i_dts
=
input_
ClockGetTS
(
p_input
,
p_pgrm
->
p_clock
,
p_block
->
i_dts
)
+
i_delay
;
input_
clock_GetTS
(
p_pgrm
->
p_clock
,
p_input
,
p_block
->
i_dts
)
+
i_delay
;
}
if
(
p_block
->
i_pts
>
0
&&
(
p_block
->
i_flags
&
BLOCK_FLAG_PREROLL
)
)
{
...
...
@@ -1555,7 +1555,7 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
else
if
(
p_block
->
i_pts
>
0
)
{
p_block
->
i_pts
=
input_
ClockGetTS
(
p_input
,
p_pgrm
->
p_clock
,
p_block
->
i_pts
)
+
i_delay
;
input_
clock_GetTS
(
p_pgrm
->
p_clock
,
p_input
,
p_block
->
i_pts
)
+
i_delay
;
}
if
(
p_block
->
i_rate
==
INPUT_RATE_DEFAULT
&&
es
->
fmt
.
i_codec
==
VLC_FOURCC
(
't'
,
'e'
,
'l'
,
'x'
)
)
...
...
@@ -1910,13 +1910,13 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
i_pcr
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
/* search program
* TODO do not use mdate() but proper stream acquisition date */
input_
ClockSetPCR
(
p_sys
->
p_input
,
p_pgrm
->
p_clock
,
i_pcr
,
mdate
()
);
input_
clock_SetPCR
(
p_pgrm
->
p_clock
,
p_sys
->
p_input
,
i_pcr
,
mdate
()
);
return
VLC_SUCCESS
;
}
case
ES_OUT_RESET_PCR
:
for
(
i
=
0
;
i
<
p_sys
->
i_pgrm
;
i
++
)
input_
Clock
ResetPCR
(
p_sys
->
pgrm
[
i
]
->
p_clock
);
input_
clock_
ResetPCR
(
p_sys
->
pgrm
[
i
]
->
p_clock
);
return
VLC_SUCCESS
;
case
ES_OUT_GET_TS
:
...
...
@@ -1924,8 +1924,8 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
{
int64_t
i_ts
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
int64_t
*
pi_ts
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_ts
=
input_
ClockGetTS
(
p_sys
->
p_input
,
p_sys
->
p_pgrm
->
p_clock
,
i_ts
);
*
pi_ts
=
input_
clock_GetTS
(
p_sys
->
p_pgrm
->
p_clock
,
p_sys
->
p_input
,
i_ts
);
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
...
...
@@ -1998,8 +1998,8 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
if
(
!
es
||
!
es
->
p_dec
)
return
VLC_EGENERIC
;
/* XXX We should call input_
Clock
GetTS but PCR has been reseted
* and it will return 0, so we won't call input_
Clock
GetTS on all preroll samples
/* XXX We should call input_
clock_
GetTS but PCR has been reseted
* and it will return 0, so we won't call input_
clock_
GetTS on all preroll samples
* but that's ugly(more time discontinuity), it need to be improved -- fenrir */
es
->
i_preroll_end
=
i_date
;
...
...
src/input/input_internal.h
View file @
da5a30e4
...
...
@@ -358,15 +358,15 @@ bool input_EsOutDecodersEmpty( es_out_t * );
/* clock.c */
typedef
struct
input_clock_t
input_clock_t
;
input_clock_t
*
input_
Clock
New
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
);
void
input_
Clock
Delete
(
input_clock_t
*
);
void
input_
ClockSetPCR
(
input_thread_t
*
,
input_clock
_t
*
,
mtime_t
i_clock
,
mtime_t
i_system
);
void
input_
Clock
ResetPCR
(
input_clock_t
*
);
mtime_t
input_
ClockGetTS
(
input_thread_t
*
,
input_clock
_t
*
,
mtime_t
);
void
input_
Clock
SetRate
(
input_clock_t
*
cl
,
int
i_rate
);
void
input_
Clock
SetMaster
(
input_clock_t
*
cl
,
bool
b_master
);
mtime_t
input_
ClockGetWakeup
(
input_thread_t
*
,
input_clock_t
*
cl
);
input_clock_t
*
input_
clock_
New
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
);
void
input_
clock_
Delete
(
input_clock_t
*
);
void
input_
clock_SetPCR
(
input_clock_t
*
,
input_thread
_t
*
,
mtime_t
i_clock
,
mtime_t
i_system
);
void
input_
clock_
ResetPCR
(
input_clock_t
*
);
mtime_t
input_
clock_GetTS
(
input_clock_t
*
,
input_thread
_t
*
,
mtime_t
);
void
input_
clock_
SetRate
(
input_clock_t
*
cl
,
int
i_rate
);
void
input_
clock_
SetMaster
(
input_clock_t
*
cl
,
bool
b_master
);
mtime_t
input_
clock_GetWakeup
(
input_clock_t
*
cl
,
input_thread_t
*
);
/* Subtitles */
char
**
subtitles_Detect
(
input_thread_t
*
,
char
*
path
,
const
char
*
fname
);
...
...
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