Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8649a34c authored by François Gaffie's avatar François Gaffie Committed by Eric Laurent
Browse files

audio policy: configurable engine: fix dead lock issue



This patch fixes a dead lock issue within configurable engine
of the audio policy. A clear was calling itself in loop instead
of calling clear on its base class.

Change-Id: I9f7c5f6425fbba36e029664ac130cbeafeca4ddf
Signed-off-by: default avatarFrançois Gaffie <francois.gaffie@intel.com>
parent 3f273d10
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ template <typename Key>
class Collection : public std::map<Key, Element<Key> *>
{
private:
    typedef std::map<Key, Element<Key> *> Base;
    typedef Element<Key> T;
    typedef typename std::map<Key, T *>::iterator CollectionIterator;
    typedef typename std::map<Key, T *>::const_iterator CollectionConstIterator;
@@ -127,7 +128,7 @@ public:
        for (it = (*this).begin(); it != (*this).end(); ++it) {
            delete it->second;
        }
        (*this).clear();
        Base::clear();
    }

private:
+2 −2
Original line number Diff line number Diff line
@@ -65,12 +65,12 @@ routing_strategy Element<audio_stream_type_t>::get<routing_strategy>() const
status_t Element<audio_stream_type_t>::setVolumeProfile(Volume::device_category category,
                                                        const VolumeCurvePoints &points)
{
    ALOGD("%s: adding volume profile for %s for device category %d, points nb =%d", __FUNCTION__,
    ALOGD("%s: adding volume profile for %s for device category %d, points nb =%zu", __FUNCTION__,
          getName().c_str(), category, points.size());
    mVolumeProfiles[category] = points;

    for (size_t i = 0; i < points.size(); i++) {
        ALOGV("%s: %s cat=%d curve index =%d Index=%d dBAttenuation=%f",
        ALOGV("%s: %s cat=%d curve index =%zu Index=%d dBAttenuation=%f",
              __FUNCTION__, getName().c_str(), category, i, points[i].mIndex,
             points[i].mDBAttenuation);
    }