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

Commit bbed5f51 authored by Divya Narayanan Poojary's avatar Divya Narayanan Poojary Committed by Steve Kondik
Browse files

audio:Avoid VideoLagUpdate if there is no AudioPlayer

-When AudioTrack is failed to initialized, mAudioPlayer
 is deleted in onVideoEvent but onVideoLagUpdate() is still
 trying to access mAudioPlayer which is leading to a crash.
 The function onVideoLagUpdate() is used to notify if video
 is lagging behind audio. So this function is no longer
 valid if AudioPlayer is deleted.

-Fix is to add a check for AudioPlayer in onVideoLagUpdate,
 which will avoid onVideoLagUpdate() if there is no
 AudioPlayer

Change-Id: Ie8dbfc1995a3da88a4a435ec2de86b1c22a07c65
CRs-Fixed: 647200
parent 76b904c1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ void AwesomePlayer::ensureCacheIsFetching_l() {

void AwesomePlayer::onVideoLagUpdate() {
    Mutex::Autolock autoLock(mLock);
    if (!mVideoLagEventPending) {
    if (!mVideoLagEventPending || mAudioPlayer == NULL) {
        return;
    }
    mVideoLagEventPending = false;