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
42693233
Commit
42693233
authored
Oct 10, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change ES_OUT_SET_NEXT_DISPLAY_TIME parameters.
It is cleaner but break the ABI.
parent
4d4f76fd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
46 deletions
+25
-46
include/vlc_es_out.h
include/vlc_es_out.h
+2
-2
modules/demux/avi/avi.c
modules/demux/avi/avi.c
+1
-2
modules/demux/flac.c
modules/demux/flac.c
+2
-5
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment.cpp
+1
-2
modules/demux/mkv/mkv.cpp
modules/demux/mkv/mkv.cpp
+2
-3
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+4
-7
src/input/es_out.c
src/input/es_out.c
+13
-25
No files found.
include/vlc_es_out.h
View file @
42693233
...
...
@@ -86,8 +86,8 @@ enum es_out_query_e
/* Try not to use this one as it is a bit hacky */
ES_OUT_SET_FMT
,
/* arg1= es_out_id_t* arg2=es_format_t* */
/* Allow preroll of data (data with dts/pts < i_pts for
one
ES will be decoded but not displayed */
ES_OUT_SET_NEXT_DISPLAY_TIME
,
/* arg1=
es_out_id_t* arg2=
int64_t i_pts(microsecond) */
/* Allow preroll of data (data with dts/pts < i_pts for
all
ES will be decoded but not displayed */
ES_OUT_SET_NEXT_DISPLAY_TIME
,
/* arg1=int64_t i_pts(microsecond) */
/* Set meta data for group (dynamic) */
ES_OUT_SET_GROUP_META
,
/* arg1=int i_group arg2=vlc_meta_t */
/* Set epg for group (dynamic) */
...
...
modules/demux/avi/avi.c
View file @
42693233
...
...
@@ -1381,6 +1381,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent )
AVI_TrackSeek
(
p_demux
,
i_stream
,
i_date
);
}
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
i_date
);
p_sys
->
i_time
=
i_date
;
msg_Dbg
(
p_demux
,
"seek: %"
PRId64
" seconds"
,
p_sys
->
i_time
/
1000000
);
return
VLC_SUCCESS
;
...
...
@@ -1811,8 +1812,6 @@ static int AVI_TrackSeek( demux_t *p_demux,
return
VLC_EGENERIC
;
}
}
if
(
p_stream
->
p_es
)
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
p_stream
->
p_es
,
i_date
);
}
#if 0
else
...
...
modules/demux/flac.c
View file @
42693233
...
...
@@ -229,10 +229,7 @@ static int Demux( demux_t *p_demux )
p_block_out
->
i_dts
+=
p_sys
->
i_time_offset
;
/* set PCR */
if
(
p_block_out
->
i_dts
>=
p_sys
->
i_pts_start
+
p_sys
->
i_time_offset
)
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block_out
->
i_dts
);
else
es_out_Control
(
p_demux
->
out
,
ES_OUT_RESET_PCR
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block_out
->
i_dts
);
es_out_Send
(
p_demux
->
out
,
p_sys
->
p_es
,
p_block_out
);
...
...
@@ -306,7 +303,7 @@ static int ControlSetTime( demux_t *p_demux, int64_t i_time )
p_sys
->
i_time_offset
=
p_sys
->
seekpoint
[
i
]
->
i_time_offset
-
p_sys
->
i_pts
;
p_sys
->
i_pts_start
=
p_sys
->
i_pts
+
i_delta_time
;
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
p_sys
->
p_es
,
p_sys
->
i_pts_start
+
p_sys
->
i_time_offset
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
p_sys
->
i_pts_start
+
p_sys
->
i_time_offset
);
}
else
{
...
...
modules/demux/mkv/matroska_segment.cpp
View file @
42693233
...
...
@@ -1097,9 +1097,8 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
ES_OUT_SET_DEFAULT
,
tracks
[
i_track
]
->
p_es
);
}
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
tracks
[
i_track
]
->
p_es
,
i_start_time
);
}
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
i_start_time
);
sys
.
i_start_pts
=
i_start_time
;
// reset the stream reading to the first cluster of the segment used
...
...
modules/demux/mkv/mkv.cpp
View file @
42693233
...
...
@@ -701,8 +701,8 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
tracks
[
i_track
]
->
b_search_keyframe
=
true
;
i_track_skipping
++
;
}
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
tracks
[
i_track
]
->
p_es
,
i_date
);
}
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
i_date
);
while
(
i_track_skipping
>
0
)
{
...
...
@@ -759,8 +759,7 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
{
sys
.
i_start_pts
=
sys
.
i_pts
;
for
(
i_track
=
0
;
i_track
<
tracks
.
size
();
i_track
++
)
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
tracks
[
i_track
]
->
p_es
,
sys
.
i_start_pts
);
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
sys
.
i_start_pts
);
}
}
...
...
modules/demux/mp4/mp4.c
View file @
42693233
...
...
@@ -759,6 +759,9 @@ static int Seek( demux_t *p_demux, mtime_t i_date )
MP4_TrackSeek
(
p_demux
,
tk
,
i_date
);
}
MP4_UpdateSeekpoint
(
p_demux
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
i_date
);
return
VLC_SUCCESS
;
}
...
...
@@ -2321,15 +2324,9 @@ static int MP4_TrackSeek( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
b_selected
=
true
;
if
(
TrackGotoChunkSample
(
p_demux
,
p_track
,
i_chunk
,
i_sample
)
==
VLC_SUCCESS
)
{
if
(
!
TrackGotoChunkSample
(
p_demux
,
p_track
,
i_chunk
,
i_sample
)
)
p_track
->
b_selected
=
true
;
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
p_track
->
p_es
,
i_start
);
}
return
p_track
->
b_selected
?
VLC_SUCCESS
:
VLC_EGENERIC
;
}
...
...
src/input/es_out.c
View file @
42693233
...
...
@@ -77,9 +77,6 @@ struct es_out_id_t
int
i_id
;
es_out_pgrm_t
*
p_pgrm
;
/* Misc. */
int64_t
i_preroll_end
;
/* Channel in the track type */
int
i_channel
;
es_format_t
fmt
;
...
...
@@ -140,6 +137,9 @@ struct es_out_sys_t
/* Rate used for clock */
int
i_rate
;
/* Current preroll */
int64_t
i_preroll_end
;
/* Used for buffering */
bool
b_buffering
;
...
...
@@ -282,6 +282,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, int i_rate )
p_sys
->
i_rate
=
i_rate
;
p_sys
->
b_buffering
=
true
;
p_sys
->
i_preroll_end
=
-
1
;
p_sys
->
p_sout_record
=
NULL
;
...
...
@@ -511,6 +512,7 @@ void input_EsOutChangePosition( es_out_t *out )
input_clock_Reset
(
p_sys
->
pgrm
[
i
]
->
p_clock
);
p_sys
->
b_buffering
=
true
;
p_sys
->
i_preroll_end
=
-
1
;
}
bool
input_EsOutDecodersIsEmpty
(
es_out_t
*
out
)
...
...
@@ -562,16 +564,8 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
return
;
mtime_t
i_preroll_duration
=
0
;
mtime_t
i_preroll_end
=
0
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
es_out_id_t
*
p_es
=
p_sys
->
es
[
i
];
if
(
p_es
->
p_dec
&&
p_es
->
i_preroll_end
>
0
)
i_preroll_end
=
__MAX
(
i_preroll_end
,
p_es
->
i_preroll_end
);
}
if
(
i_preroll_end
>
0
)
i_preroll_duration
=
__MAX
(
i_preroll_end
-
i_stream_start
,
0
);
if
(
p_sys
->
i_preroll_end
>=
0
)
i_preroll_duration
=
__MAX
(
p_sys
->
i_preroll_end
-
i_stream_start
,
0
);
if
(
i_stream_duration
<=
p_sys
->
p_input
->
i_pts_delay
+
i_preroll_duration
&&
!
b_forced
)
{
...
...
@@ -582,14 +576,13 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
msg_Dbg
(
p_sys
->
p_input
,
"Stream buffering done (%d ms in %d ms)"
,
(
int
)(
i_stream_duration
/
1000
),
(
int
)(
i_system_duration
/
1000
)
);
p_sys
->
b_buffering
=
false
;
p_sys
->
i_preroll_end
=
-
1
;
const
mtime_t
i_decoder_buffering_start
=
mdate
();
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
es_out_id_t
*
p_es
=
p_sys
->
es
[
i
];
p_es
->
i_preroll_end
=
-
1
;
if
(
!
p_es
->
p_dec
)
continue
;
input_DecoderWaitBuffering
(
p_es
->
p_dec
);
...
...
@@ -1196,7 +1189,6 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
es
->
i_id
=
fmt
->
i_id
;
es
->
p_pgrm
=
p_pgrm
;
es_format_Copy
(
&
es
->
fmt
,
fmt
);
es
->
i_preroll_end
=
-
1
;
switch
(
fmt
->
i_cat
)
{
...
...
@@ -1390,7 +1382,6 @@ static void EsSelect( es_out_t *out, es_out_id_t *es )
}
}
es
->
i_preroll_end
=
-
1
;
EsCreateDecoder
(
out
,
es
);
if
(
es
->
p_dec
==
NULL
||
es
->
p_pgrm
!=
p_sys
->
p_pgrm
)
...
...
@@ -1677,13 +1668,13 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
}
/* Mark preroll blocks */
if
(
e
s
->
i_preroll_end
>=
0
)
if
(
p_sy
s
->
i_preroll_end
>=
0
)
{
int64_t
i_date
=
p_block
->
i_pts
;
if
(
i_date
<=
0
)
i_date
=
p_block
->
i_dts
;
if
(
i_date
<
e
s
->
i_preroll_end
)
if
(
i_date
<
p_sy
s
->
i_preroll_end
)
p_block
->
i_flags
|=
BLOCK_FLAG_PREROLL
;
}
...
...
@@ -2106,15 +2097,12 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
case
ES_OUT_SET_NEXT_DISPLAY_TIME
:
{
int64_t
i_date
;
es
=
(
es_out_id_t
*
)
va_arg
(
args
,
es_out_id_t
*
);
i_date
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
const
int64_t
i_date
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
if
(
!
es
||
!
es
->
p_dec
)
if
(
i_date
<
0
)
return
VLC_EGENERIC
;
e
s
->
i_preroll_end
=
i_date
;
p_sy
s
->
i_preroll_end
=
i_date
;
return
VLC_SUCCESS
;
}
...
...
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