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
30ab1259
Commit
30ab1259
authored
May 08, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: lock stream output queue
parent
2a59243d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
modules/demux/adaptative/Streams.cpp
modules/demux/adaptative/Streams.cpp
+19
-7
modules/demux/adaptative/Streams.hpp
modules/demux/adaptative/Streams.hpp
+1
-1
No files found.
modules/demux/adaptative/Streams.cpp
View file @
30ab1259
...
...
@@ -261,6 +261,8 @@ AbstractStreamOutput::AbstractStreamOutput(demux_t *demux)
if
(
!
fakeesout
)
throw
VLC_ENOMEM
;
vlc_mutex_init
(
&
lock
);
fakeesout
->
pf_add
=
esOutAdd
;
fakeesout
->
pf_control
=
esOutControl
;
fakeesout
->
pf_del
=
esOutDel
;
...
...
@@ -274,6 +276,13 @@ AbstractStreamOutput::~AbstractStreamOutput()
if
(
demuxstream
)
stream_Delete
(
demuxstream
);
delete
fakeesout
;
vlc_mutex_destroy
(
&
lock
);
/* shouldn't be any */
std
::
list
<
Demuxed
*>::
const_iterator
it
;
for
(
it
=
queues
.
begin
();
it
!=
queues
.
end
();
++
it
)
delete
*
it
;
}
mtime_t
AbstractStreamOutput
::
getPCR
()
const
...
...
@@ -303,6 +312,7 @@ bool AbstractStreamOutput::seekAble() const
void
AbstractStreamOutput
::
setPosition
(
mtime_t
nztime
)
{
vlc_mutex_lock
(
&
lock
);
std
::
list
<
Demuxed
*>::
const_iterator
it
;
for
(
it
=
queues
.
begin
();
it
!=
queues
.
end
();
++
it
)
{
...
...
@@ -311,12 +321,14 @@ void AbstractStreamOutput::setPosition(mtime_t nztime)
pair
->
drop
();
}
pcr
=
VLC_TS_0
;
vlc_mutex_unlock
(
&
lock
);
es_out_Control
(
realdemux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
VLC_TS_0
+
nztime
);
}
void
AbstractStreamOutput
::
sendToDecoder
(
mtime_t
nzdeadline
)
{
vlc_mutex_lock
(
&
lock
);
std
::
list
<
Demuxed
*>::
const_iterator
it
;
for
(
it
=
queues
.
begin
();
it
!=
queues
.
end
();
++
it
)
{
...
...
@@ -333,13 +345,7 @@ void AbstractStreamOutput::sendToDecoder(mtime_t nzdeadline)
realdemux
->
out
->
pf_send
(
realdemux
->
out
,
pair
->
es_id
,
p_block
);
}
}
}
void
AbstractStreamOutput
::
dropQueues
()
{
std
::
list
<
Demuxed
*>::
const_iterator
it
;
for
(
it
=
queues
.
begin
();
it
!=
queues
.
end
();
++
it
)
(
*
it
)
->
drop
();
vlc_mutex_unlock
(
&
lock
);
}
AbstractStreamOutput
::
Demuxed
::
Demuxed
()
...
...
@@ -368,12 +374,14 @@ es_out_id_t * AbstractStreamOutput::esOutAdd(es_out_t *fakees, const es_format_t
es_out_id_t
*
p_es
=
me
->
realdemux
->
out
->
pf_add
(
me
->
realdemux
->
out
,
p_fmt
);
if
(
p_es
)
{
vlc_mutex_lock
(
&
me
->
lock
);
Demuxed
*
pair
=
new
(
std
::
nothrow
)
Demuxed
();
if
(
pair
)
{
pair
->
es_id
=
p_es
;
me
->
queues
.
push_back
(
pair
);
}
vlc_mutex_unlock
(
&
me
->
lock
);
}
return
p_es
;
}
...
...
@@ -381,6 +389,7 @@ es_out_id_t * AbstractStreamOutput::esOutAdd(es_out_t *fakees, const es_format_t
int
AbstractStreamOutput
::
esOutSend
(
es_out_t
*
fakees
,
es_out_id_t
*
p_es
,
block_t
*
p_block
)
{
AbstractStreamOutput
*
me
=
(
AbstractStreamOutput
*
)
fakees
->
p_sys
;
vlc_mutex_lock
(
&
me
->
lock
);
std
::
list
<
Demuxed
*>::
const_iterator
it
;
for
(
it
=
me
->
queues
.
begin
();
it
!=
me
->
queues
.
end
();
++
it
)
{
...
...
@@ -391,12 +400,14 @@ int AbstractStreamOutput::esOutSend(es_out_t *fakees, es_out_id_t *p_es, block_t
break
;
}
}
vlc_mutex_unlock
(
&
me
->
lock
);
return
VLC_SUCCESS
;
}
void
AbstractStreamOutput
::
esOutDel
(
es_out_t
*
fakees
,
es_out_id_t
*
p_es
)
{
AbstractStreamOutput
*
me
=
(
AbstractStreamOutput
*
)
fakees
->
p_sys
;
vlc_mutex_lock
(
&
me
->
lock
);
std
::
list
<
Demuxed
*>::
iterator
it
;
for
(
it
=
me
->
queues
.
begin
();
it
!=
me
->
queues
.
end
();
++
it
)
{
...
...
@@ -408,6 +419,7 @@ void AbstractStreamOutput::esOutDel(es_out_t *fakees, es_out_id_t *p_es)
break
;
}
}
vlc_mutex_unlock
(
&
me
->
lock
);
me
->
realdemux
->
out
->
pf_del
(
me
->
realdemux
->
out
,
p_es
);
}
...
...
modules/demux/adaptative/Streams.hpp
View file @
30ab1259
...
...
@@ -97,7 +97,6 @@ namespace adaptative
bool
seekAble
()
const
;
void
setPosition
(
mtime_t
);
void
sendToDecoder
(
mtime_t
);
void
dropQueues
();
protected:
mtime_t
pcr
;
...
...
@@ -125,6 +124,7 @@ namespace adaptative
block_t
**
pp_queue_last
;
};
std
::
list
<
Demuxed
*>
queues
;
vlc_mutex_t
lock
;
};
class
MP4StreamOutput
:
public
AbstractStreamOutput
...
...
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