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

Commit 82977501 authored by nadlabak's avatar nadlabak
Browse files

Revert "framework/base: Fix for Camera shutter sound heard twice"

This reverts commit 38ce282c.
revert reason: breaks playback position in MortPlayer Audio Book,
DogCattcher and other media players
parent 72bd1410
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -941,6 +941,7 @@ status_t AwesomePlayer::play_l() {
        }
}
#endif
    bool deferredAudioSeek = false;

    if (mAudioSource != NULL) {
        if (mAudioPlayer == NULL) {
@@ -948,10 +949,6 @@ status_t AwesomePlayer::play_l() {
                mAudioPlayer = new AudioPlayer(mAudioSink, this);
                mAudioPlayer->setSource(mAudioSource);

                // If there was a seek request while we were paused
                // and we're just starting up again, honor the request now.
                seekAudioIfNecessary_l();

                // We've already started the MediaSource in order to enable
                // the prefetcher to read its data.
                status_t err = mAudioPlayer->start(
@@ -973,6 +970,8 @@ status_t AwesomePlayer::play_l() {

                mTimeSource = mAudioPlayer;

                deferredAudioSeek = true;

                mWatchForAudioSeekComplete = false;
                mWatchForAudioEOS = true;
            }
@@ -1008,6 +1007,12 @@ status_t AwesomePlayer::play_l() {
        postVideoEvent_l();
    }

    if (deferredAudioSeek) {
        // If there was a seek request while we were paused
        // and we're just starting up again, honor the request now.
        seekAudioIfNecessary_l();
    }

    if (mFlags & AT_EOS) {
        // Legacy behaviour, if a stream finishes playing and then
        // is started again, we play from the start...