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

Commit cbcbb79c authored by Toshikazu Saito's avatar Toshikazu Saito Committed by Takahiro Aizawa
Browse files

Avoid scanning sources when decoder state is shutdown

If creating MediaCodec is failed, decoder notifies error and shutdown
of decoder is requested. In that case, NuPlayer::flushDecoder()
requests performScanSources() if mScanSourcesPending is true. By this
request, kWhatScanSources is posted again and instantiating decoder
is also requested again. This processing is executed continuously and
error is notified many times.
This fix limits running performScanSources() only when needShutdown is
false

Bug: 28627498

Change-Id: I7b7a82ad8fdf493b58ce95670e37e77533295ddc
parent 2d772fd4
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1675,8 +1675,10 @@ void NuPlayer::flushDecoder(bool audio, bool needShutdown) {
    // Make sure we don't continue to scan sources until we finish flushing.
    ++mScanSourcesGeneration;
    if (mScanSourcesPending) {
        if (!needShutdown) {
            mDeferredActions.push_back(
                    new SimpleAction(&NuPlayer::performScanSources));
        }
        mScanSourcesPending = false;
    }