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

Commit 01f69476 authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "RTSPSource: pause internally when buffering starts." into nyc-dev

parents f489ff89 c9ff2009
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -2194,11 +2194,6 @@ void NuPlayer::onSourceNotify(const sp<AMessage> &msg) {
                mPausedForBuffering = true;
                mPausedForBuffering = true;
                onPause();
                onPause();
            }
            }
            // fall-thru
        }

        case Source::kWhatBufferingStart:
        {
            notifyListener(MEDIA_INFO, MEDIA_INFO_BUFFERING_START, 0);
            notifyListener(MEDIA_INFO, MEDIA_INFO_BUFFERING_START, 0);
            break;
            break;
        }
        }
@@ -2216,11 +2211,6 @@ void NuPlayer::onSourceNotify(const sp<AMessage> &msg) {
                    onResume();
                    onResume();
                }
                }
            }
            }
            // fall-thru
        }

        case Source::kWhatBufferingEnd:
        {
            notifyListener(MEDIA_INFO, MEDIA_INFO_BUFFERING_END, 0);
            notifyListener(MEDIA_INFO, MEDIA_INFO_BUFFERING_END, 0);
            break;
            break;
        }
        }
+0 −2
Original line number Original line Diff line number Diff line
@@ -46,8 +46,6 @@ struct NuPlayer::Source : public AHandler {
        kWhatFlagsChanged,
        kWhatFlagsChanged,
        kWhatVideoSizeChanged,
        kWhatVideoSizeChanged,
        kWhatBufferingUpdate,
        kWhatBufferingUpdate,
        kWhatBufferingStart,
        kWhatBufferingEnd,
        kWhatPauseOnBufferingStart,
        kWhatPauseOnBufferingStart,
        kWhatResumeOnBufferingEnd,
        kWhatResumeOnBufferingEnd,
        kWhatCacheStats,
        kWhatCacheStats,
+2 −2
Original line number Original line Diff line number Diff line
@@ -778,7 +778,7 @@ void NuPlayer::RTSPSource::startBufferingIfNecessary() {
        mBuffering = true;
        mBuffering = true;


        sp<AMessage> notify = dupNotify();
        sp<AMessage> notify = dupNotify();
        notify->setInt32("what", kWhatBufferingStart);
        notify->setInt32("what", kWhatPauseOnBufferingStart);
        notify->post();
        notify->post();
    }
    }
}
}
@@ -794,7 +794,7 @@ bool NuPlayer::RTSPSource::stopBufferingIfNecessary() {
        mBuffering = false;
        mBuffering = false;


        sp<AMessage> notify = dupNotify();
        sp<AMessage> notify = dupNotify();
        notify->setInt32("what", kWhatBufferingEnd);
        notify->setInt32("what", kWhatResumeOnBufferingEnd);
        notify->post();
        notify->post();
    }
    }