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
85e74366
Commit
85e74366
authored
Jul 15, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: add offset to streams
parent
052ac2b0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
modules/demux/adaptative/Streams.cpp
modules/demux/adaptative/Streams.cpp
+26
-5
modules/demux/adaptative/Streams.hpp
modules/demux/adaptative/Streams.hpp
+2
-0
No files found.
modules/demux/adaptative/Streams.cpp
View file @
85e74366
...
...
@@ -308,6 +308,7 @@ BaseStreamOutput::BaseStreamOutput(demux_t *demux, const StreamFormat &format, c
restarting
=
false
;
demuxstream
=
NULL
;
b_drop
=
false
;
timestamps_offset
=
VLC_TS_INVALID
;
fakeesout
=
new
es_out_t
;
if
(
!
fakeesout
)
...
...
@@ -466,6 +467,13 @@ void BaseStreamOutput::sendToDecoderUnlocked(mtime_t nzdeadline)
}
}
void
BaseStreamOutput
::
setTimestampOffset
(
mtime_t
offset
)
{
vlc_mutex_lock
(
&
lock
);
timestamps_offset
=
VLC_TS_0
+
offset
;
vlc_mutex_unlock
(
&
lock
);
}
BaseStreamOutput
::
Demuxed
::
Demuxed
(
es_out_id_t
*
id
,
const
es_format_t
*
fmt
)
{
p_queue
=
NULL
;
...
...
@@ -551,6 +559,15 @@ int BaseStreamOutput::esOutSend(es_out_t *fakees, es_out_id_t *p_es, block_t *p_
}
else
{
if
(
me
->
timestamps_offset
>
VLC_TS_INVALID
)
{
if
(
p_block
->
i_dts
>
VLC_TS_INVALID
)
p_block
->
i_dts
+=
(
me
->
timestamps_offset
-
VLC_TS_0
);
if
(
p_block
->
i_pts
>
VLC_TS_INVALID
)
p_block
->
i_pts
+=
(
me
->
timestamps_offset
-
VLC_TS_0
);
}
std
::
list
<
Demuxed
*>::
const_iterator
it
;
for
(
it
=
me
->
queues
.
begin
();
it
!=
me
->
queues
.
end
();
++
it
)
{
...
...
@@ -604,17 +621,21 @@ int BaseStreamOutput::esOutControl(es_out_t *fakees, int i_query, va_list args)
BaseStreamOutput
*
me
=
(
BaseStreamOutput
*
)
fakees
->
p_sys
;
if
(
i_query
==
ES_OUT_SET_PCR
)
{
vlc_mutex_lock
(
&
me
->
lock
);
me
->
pcr
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
vlc_mutex_unlock
(
&
me
->
lock
);
vlc_mutex_lock
(
&
lock
);
pcr
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
if
(
me
->
pcr
>
VLC_TS_INVALID
&&
me
->
timestamps_offset
>
VLC_TS_INVALID
)
me
->
pcr
+=
(
me
->
timestamps_offset
-
VLC_TS_0
);
vlc_mutex_unlock
(
&
lock
);
return
VLC_SUCCESS
;
}
else
if
(
i_query
==
ES_OUT_SET_GROUP_PCR
)
{
vlc_mutex_lock
(
&
me
->
lock
);
vlc_mutex_lock
(
&
lock
);
me
->
group
=
(
int
)
va_arg
(
args
,
int
);
me
->
pcr
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
vlc_mutex_unlock
(
&
me
->
lock
);
if
(
me
->
pcr
>
VLC_TS_INVALID
&&
me
->
timestamps_offset
>
VLC_TS_INVALID
)
me
->
pcr
+=
(
me
->
timestamps_offset
-
VLC_TS_0
);
vlc_mutex_unlock
(
&
lock
);
return
VLC_SUCCESS
;
}
else
if
(
i_query
==
ES_OUT_GET_ES_STATE
)
...
...
modules/demux/adaptative/Streams.hpp
View file @
85e74366
...
...
@@ -142,6 +142,7 @@ namespace adaptative
virtual
void
sendToDecoder
(
mtime_t
);
/* reimpl */
virtual
bool
reinitsOnSeek
()
const
;
/* reimpl */
virtual
bool
switchAllowed
()
const
;
/* reimpl */
void
setTimestampOffset
(
mtime_t
);
protected:
es_out_t
*
fakeesout
;
/* to intercept/proxy what is sent from demuxstream */
...
...
@@ -149,6 +150,7 @@ namespace adaptative
bool
seekable
;
std
::
string
name
;
bool
restarting
;
mtime_t
timestamps_offset
;
private:
static
es_out_id_t
*
esOutAdd
(
es_out_t
*
,
const
es_format_t
*
);
...
...
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