зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1133461 - [RTSP] Remove the extra PLAY request for seek operation. r=bechen
This commit is contained in:
Родитель
e8b4f395c0
Коммит
5bc6a1cede
|
@ -48,6 +48,7 @@ RtspOmxReader::Seek(int64_t aTime, int64_t aEndTime)
|
|||
// seek operation. The function will clear the |mVideoQueue| and |mAudioQueue|
|
||||
// that store the decoded data and also call the |DecodeToTarget| to pass
|
||||
// the seek time to OMX a/v decoders.
|
||||
mEnsureActiveFromSeek = true;
|
||||
return MediaOmxReader::Seek(aTime, aEndTime);
|
||||
}
|
||||
|
||||
|
@ -71,9 +72,13 @@ void RtspOmxReader::EnsureActive() {
|
|||
if (mRtspResource) {
|
||||
nsIStreamingProtocolController* controller =
|
||||
mRtspResource->GetMediaStreamController();
|
||||
if (controller) {
|
||||
// We do not have to call Play if the EnsureActive request is from Seek
|
||||
// operation because RTSP connection must already be established before
|
||||
// performing Seek.
|
||||
if (controller && !mEnsureActiveFromSeek) {
|
||||
controller->Play();
|
||||
}
|
||||
mEnsureActiveFromSeek = false;
|
||||
mRtspResource->SetSuspend(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,9 @@ protected:
|
|||
|
||||
public:
|
||||
RtspOmxReader(AbstractMediaDecoder* aDecoder)
|
||||
: MediaOmxReader(aDecoder) {
|
||||
: MediaOmxReader(aDecoder)
|
||||
, mEnsureActiveFromSeek(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(RtspOmxReader);
|
||||
NS_ASSERTION(mDecoder, "RtspOmxReader mDecoder is null.");
|
||||
NS_ASSERTION(mDecoder->GetResource(),
|
||||
|
@ -73,6 +75,8 @@ private:
|
|||
// holds the MediaDecoderStateMachine and RtspMediaResource.
|
||||
// And MediaDecoderStateMachine holds this RtspOmxReader.
|
||||
RtspMediaResource* mRtspResource;
|
||||
|
||||
bool mEnsureActiveFromSeek;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -218,7 +218,11 @@ status_t RTSPSource::seekTo(int64_t seekTimeUs) {
|
|||
sp<AMessage> msg = new AMessage(kWhatPerformSeek, mReflector->id());
|
||||
msg->setInt32("generation", ++mSeekGeneration);
|
||||
msg->setInt64("timeUs", seekTimeUs);
|
||||
msg->post(200000ll);
|
||||
// The original code in Android posts this message for 200ms delay in order
|
||||
// to avoid performing multiple seeks in a short period of time. This is not
|
||||
// necessary for us because MediaDecoderStateMachine already circumvents
|
||||
// that situation.
|
||||
msg->post();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче