Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
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
Hide 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_
C
lockNew: create a new clock
* input_
c
lock
_
New: create a new clock
*****************************************************************************/
input_clock_t
*
input_
C
lockNew
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
)
input_clock_t
*
input_
c
lock
_
New
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
)
{
input_clock_t
*
cl
=
malloc
(
sizeof
(
*
cl
)
);
if
(
!
cl
)
...
...
@@ -164,22 +164,22 @@ input_clock_t *input_ClockNew( bool b_master, int i_cr_average, int i_rate )
}
/*****************************************************************************
* input_
C
lockDelete: destroy a new clock
* input_
c
lock
_
Delete: destroy a new clock
*****************************************************************************/
void
input_
C
lockDelete
(
input_clock_t
*
cl
)
void
input_
c
lock
_
Delete
(
input_clock_t
*
cl
)
{
free
(
cl
);
}
/*****************************************************************************
* input_
C
lockSetPCR: manages a clock reference
* input_
c
lock
_
SetPCR: manages a clock reference
*
* i_ck_stream: date in stream clock
* i_ck_system: date in system clock
*****************************************************************************/
void
input_
C
lockSetPCR
(
input_
thread_t
*
p_input
,
input_
clock_t
*
cl
,
mtime_t
i_ck_stream
,
mtime_t
i_ck_system
)
void
input_
c
lock
_
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
;
bool
b_reset_reference
=
false
;
...
...
@@ -236,19 +236,19 @@ void input_ClockSetPCR( input_thread_t *p_input,
}
/*****************************************************************************
* input_
C
lockResetPCR:
* input_
c
lock
_
ResetPCR:
*****************************************************************************/
void
input_
C
lockResetPCR
(
input_clock_t
*
cl
)
void
input_
c
lock
_
ResetPCR
(
input_clock_t
*
cl
)
{
cl
->
b_has_reference
=
false
;
cl
->
last_pts
=
0
;
}
/*****************************************************************************
* input_
C
lockGetTS: manages a PTS or DTS
* input_
c
lock
_
GetTS: manages a PTS or DTS
*****************************************************************************/
mtime_t
input_
C
lockGetTS
(
input_
thread_t
*
p_input
,
input_
clock_t
*
cl
,
mtime_t
i_ts
)
mtime_t
input_
c
lock
_
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_
C
lockSetRate:
* input_
c
lock
_
SetRate:
*****************************************************************************/
void
input_
C
lockSetRate
(
input_clock_t
*
cl
,
int
i_rate
)
void
input_
c
lock
_
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_
C
lockSetMaster:
* input_
c
lock
_
SetMaster:
*****************************************************************************/
void
input_
C
lockSetMaster
(
input_clock_t
*
cl
,
bool
b_master
)
void
input_
c
lock
_
SetMaster
(
input_clock_t
*
cl
,
bool
b_master
)
{
cl
->
b_master
=
b_master
;
}
/*****************************************************************************
* input_
C
lockGetWakeup
* input_
c
lock
_
GetWakeup
*****************************************************************************/
mtime_t
input_
C
lockGetWakeup
(
input_
thread_t
*
p_input
,
input_clock_t
*
cl
)
mtime_t
input_
c
lock
_
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_
C
lockDelete
(
p_pgrm
->
p_clock
);
input_
c
lock
_
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_
C
lockGetWakeup
(
p_sys
->
p_
input
,
p_sys
->
p_pgrm
->
p_clock
);
return
input_
c
lock
_
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_
C
lockSetRate
(
p_sys
->
pgrm
[
i
]
->
p_clock
,
i_rate
);
input_
c
lock
_
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_
C
lockSetMaster
(
p_sys
->
p_pgrm
->
p_clock
,
false
);
input_
C
lockSetMaster
(
p_pgrm
->
p_clock
,
true
);
input_
c
lock
_
SetMaster
(
p_sys
->
p_pgrm
->
p_clock
,
false
);
input_
c
lock
_
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_
C
lockNew
(
false
,
p_input
->
p
->
input
.
i_cr_average
,
p_sys
->
i_rate
);
p_pgrm
->
p_clock
=
input_
c
lock
_
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_
C
lockDelete
(
p_pgrm
->
p_clock
);
input_
c
lock
_
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_
C
lockGetTS
(
p_input
,
p_pgrm
->
p_clock
,
p_block
->
i_dts
)
+
i_delay
;
input_
c
lock
_
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_
C
lockGetTS
(
p_input
,
p_pgrm
->
p_clock
,
p_block
->
i_pts
)
+
i_delay
;
input_
c
lock
_
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_
C
lockSetPCR
(
p_
sys
->
p_input
,
p_pgrm
->
p_clock
,
i_pcr
,
mdate
()
);
input_
c
lock
_
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_
C
lockResetPCR
(
p_sys
->
pgrm
[
i
]
->
p_clock
);
input_
c
lock
_
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_
C
lockGetTS
(
p_sys
->
p_
input
,
p_sys
->
p_
pgrm
->
p_clock
,
i_ts
);
*
pi_ts
=
input_
c
lock
_
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_
C
lockGetTS but PCR has been reseted
* and it will return 0, so we won't call input_
C
lockGetTS on all preroll samples
/* XXX We should call input_
c
lock
_
GetTS but PCR has been reseted
* and it will return 0, so we won't call input_
c
lock
_
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_
C
lockNew
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
);
void
input_
C
lockDelete
(
input_clock_t
*
);
void
input_
C
lockSetPCR
(
input_
thread
_t
*
,
input_
clock
_t
*
,
mtime_t
i_clock
,
mtime_t
i_system
);
void
input_
C
lockResetPCR
(
input_clock_t
*
);
mtime_t
input_
C
lockGetTS
(
input_
thread
_t
*
,
input_
clock
_t
*
,
mtime_t
);
void
input_
C
lockSetRate
(
input_clock_t
*
cl
,
int
i_rate
);
void
input_
C
lockSetMaster
(
input_clock_t
*
cl
,
bool
b_master
);
mtime_t
input_
C
lockGetWakeup
(
input_
thread
_t
*
,
input_
clock
_t
*
cl
);
input_clock_t
*
input_
c
lock
_
New
(
bool
b_master
,
int
i_cr_average
,
int
i_rate
);
void
input_
c
lock
_
Delete
(
input_clock_t
*
);
void
input_
c
lock
_
SetPCR
(
input_
clock
_t
*
,
input_
thread
_t
*
,
mtime_t
i_clock
,
mtime_t
i_system
);
void
input_
c
lock
_
ResetPCR
(
input_clock_t
*
);
mtime_t
input_
c
lock
_
GetTS
(
input_
clock
_t
*
,
input_
thread
_t
*
,
mtime_t
);
void
input_
c
lock
_
SetRate
(
input_clock_t
*
cl
,
int
i_rate
);
void
input_
c
lock
_
SetMaster
(
input_clock_t
*
cl
,
bool
b_master
);
mtime_t
input_
c
lock
_
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