Commit 381b34a5 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: fix double lock on flush

parent 08b864b7
......@@ -327,6 +327,12 @@ void AbstractStreamOutput::setPosition(mtime_t nztime)
void AbstractStreamOutput::sendToDecoder(mtime_t nzdeadline)
{
vlc_mutex_lock(&lock);
sendToDecoderUnlocked(nzdeadline);
vlc_mutex_unlock(&lock);
}
void AbstractStreamOutput::sendToDecoderUnlocked(mtime_t nzdeadline)
{
std::list<Demuxed *>::const_iterator it;
for(it=queues.begin(); it!=queues.end();++it)
{
......@@ -343,7 +349,6 @@ void AbstractStreamOutput::sendToDecoder(mtime_t nzdeadline)
realdemux->out->pf_send(realdemux->out, pair->es_id, p_block);
}
}
vlc_mutex_unlock(&lock);
}
AbstractStreamOutput::Demuxed::Demuxed()
......@@ -411,7 +416,7 @@ void AbstractStreamOutput::esOutDel(es_out_t *fakees, es_out_id_t *p_es)
{
if((*it)->es_id == p_es)
{
me->sendToDecoder(INT64_MAX - VLC_TS_0);
me->sendToDecoderUnlocked(INT64_MAX - VLC_TS_0);
delete *it;
me->queues.erase(it);
break;
......
......@@ -124,6 +124,7 @@ namespace adaptative
};
std::list<Demuxed *> queues;
vlc_mutex_t lock;
void sendToDecoderUnlocked(mtime_t);
};
class MP4StreamOutput : public AbstractStreamOutput
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment