Commit fbb3542c authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: use mutable keywork on locks

parent 855a0132
......@@ -321,7 +321,7 @@ void PlaylistManager::drain()
vlc_tick_t PlaylistManager::getResumeTime() const
{
vlc_mutex_locker locker(const_cast<vlc_mutex_t *>(&demux.lock));
vlc_mutex_locker locker(&demux.lock);
return demux.i_nzpcr;
}
......
......@@ -109,7 +109,7 @@ namespace adaptive
{
vlc_tick_t i_nzpcr;
vlc_tick_t i_firstpcr;
vlc_mutex_t lock;
mutable vlc_mutex_t lock;
vlc_cond_t cond;
} demux;
......@@ -124,7 +124,7 @@ namespace adaptive
vlc_tick_t i_length;
vlc_tick_t i_time;
double f_position;
vlc_mutex_t lock;
mutable vlc_mutex_t lock;
} cached;
private:
......
......@@ -154,7 +154,7 @@ void AbstractStream::setDescription(const std::string &desc)
vlc_tick_t AbstractStream::getPCR() const
{
vlc_mutex_locker locker(const_cast<vlc_mutex_t *>(&lock));
vlc_mutex_locker locker(&lock);
if(!valid || disabled)
return VLC_TICK_INVALID;
return fakeEsOut()->commandsQueue()->getPCR();
......@@ -169,7 +169,7 @@ vlc_tick_t AbstractStream::getMinAheadTime() const
vlc_tick_t AbstractStream::getFirstDTS() const
{
vlc_mutex_locker locker(const_cast<vlc_mutex_t *>(&lock));
vlc_mutex_locker locker(&lock);
if(!valid || disabled)
return VLC_TICK_INVALID;
......
......@@ -132,7 +132,7 @@ namespace adaptive
FakeESOut::LockedFakeEsOut fakeEsOut();
FakeESOut::LockedFakeEsOut fakeEsOut() const;
FakeESOut *fakeesout; /* to intercept/proxy what is sent from demuxstream */
vlc_mutex_t lock; /* lock for everything accessed by dequeuing */
mutable vlc_mutex_t lock; /* lock for everything accessed by dequeuing */
private:
void declaredCodecs();
......
......@@ -57,9 +57,9 @@ BaseRepresentation *RateBasedAdaptationLogic::getNextRepresentation(BaseAdaptati
if(adaptSet == NULL)
return NULL;
vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
vlc_mutex_lock(&lock);
size_t availBps = currentBps + ((currep) ? currep->getBandwidth() : 0);
vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
vlc_mutex_unlock(&lock);
if(availBps > usedBps)
availBps -= usedBps;
else
......
......@@ -53,7 +53,7 @@ namespace adaptive
size_t dlsize;
vlc_tick_t dllength;
vlc_mutex_t lock;
mutable vlc_mutex_t lock;
};
class FixedRateAdaptationLogic : public AbstractAdaptationLogic
......
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