Backed out changeset d637ee5ceb51 (bug 1552145) as per request. a=backout
authorCsoregi Natalia <ncsoregi@mozilla.com>
Fri, 07 Jun 2019 00:45:43 +0300
changeset 477721 ac9c72ac6aa02aab8ab9b9987d9bf288fe6a0aa6
parent 477610 3f656afb0c08aae2ed9b2ebe4128bac71146c679
child 477722 6a81efd823dbaf60d47f339dcacc26648d06e401
push id87317
push userncsoregi@mozilla.com
push dateThu, 06 Jun 2019 22:39:43 +0000
treeherderautoland@fb6f02f359d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1552145
milestone69.0a1
backs outd637ee5ceb51cbed026b130c8e221e1be91abf02
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset d637ee5ceb51 (bug 1552145) as per request. a=backout
dom/media/hls/HLSDemuxer.cpp
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsPlayer.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsVideoRenderer.java
--- a/dom/media/hls/HLSDemuxer.cpp
+++ b/dom/media/hls/HLSDemuxer.cpp
@@ -250,25 +250,20 @@ RefPtr<HLSTrackDemuxer::SeekPromise> HLS
                                  &HLSTrackDemuxer::DoSeek, aTime);
 }
 
 RefPtr<HLSTrackDemuxer::SeekPromise> HLSTrackDemuxer::DoSeek(
     const TimeUnit& aTime) {
   MOZ_ASSERT(mParent, "Called after BreackCycle()");
   MOZ_ASSERT(mParent->OnTaskQueue());
   mQueuedSample = nullptr;
-  // The ExoPlayer on the other side of this call does an "accurate" seek,
-  // so it won't by itself seek to a key frame. So we seek to an arbitrary
-  // offset behind the seek target, and the Java demuxer will drop all
-  // frames up to the next keyframe. Basically, we cross our fingers and
-  // hope there's a keyframe before the demux reaches the seek target.
-  int64_t seekTimeUs = (aTime - TimeUnit::FromSeconds(2.0)).ToMicroseconds();
+  int64_t seekTimeUs = aTime.ToMicroseconds();
   bool result = mParent->mHLSDemuxerWrapper->Seek(seekTimeUs);
   if (!result) {
-    return SeekPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_DEMUXER_ERR,
+    return SeekPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA,
                                         __func__);
   }
   TimeUnit seekTime = TimeUnit::FromMicroseconds(seekTimeUs);
   return SeekPromise::CreateAndResolve(seekTime, __func__);
 }
 
 RefPtr<HLSTrackDemuxer::SamplesPromise> HLSTrackDemuxer::GetSamples(
     int32_t aNumSamples) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsPlayer.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsPlayer.java
@@ -377,23 +377,20 @@ public class GeckoHlsPlayer implements B
             !mExoplayerSuspended &&
             mMediaDecoderPlayState == MediaDecoderPlayState.PLAY_STATE_PLAYING) {
             resumeExoplayer();
         }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
-    public synchronized void onPositionDiscontinuity() {
+    public void onPositionDiscontinuity() {
         if (DEBUG) {
             Log.d(LOGTAG, "positionDiscontinuity");
         }
-        if (mVRenderer != null) {
-            mVRenderer.onPositionDiscontinuity();
-        }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
     public void onPlaybackParametersChanged(final PlaybackParameters playbackParameters) {
         if (DEBUG) {
             Log.d(LOGTAG, "playbackParameters " +
                   String.format("[speed=%.2f, pitch=%.2f]", playbackParameters.speed, playbackParameters.pitch));
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsVideoRenderer.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsVideoRenderer.java
@@ -48,26 +48,16 @@ public class GeckoHlsVideoRenderer exten
     private ConcurrentLinkedQueue<GeckoHLSSample> mDemuxedNoDurationSamples =
         new ConcurrentLinkedQueue<>();
 
     // Contain CSD-0(SPS)/CSD-1(PPS) information (in AnnexB format) for
     // prepending each keyframe. When video format changes, this information
     // changes accordingly.
     private byte[] mCSDInfo = null;
 
-    private boolean mDiscontinuity = false;
-
-    public void onPositionDiscontinuity() {
-        if (DEBUG) {
-            Log.d(LOGTAG, "positionDiscontinuity");
-        }
-        mDiscontinuity = true;
-        clearInputSamplesQueue();
-    }
-
     public GeckoHlsVideoRenderer(final GeckoHlsPlayer.ComponentEventDispatcher eventDispatcher) {
         super(C.TRACK_TYPE_VIDEO, eventDispatcher);
         assertTrue(Build.VERSION.SDK_INT >= 16);
         LOGTAG = getClass().getSimpleName();
         DEBUG = !BuildConfig.MOZILLA_OFFICIAL;
     }
 
     @Override
@@ -169,17 +159,16 @@ public class GeckoHlsVideoRenderer exten
             Log.d(LOGTAG, "[resetRenderer] mInitialized = " + mInitialized);
         }
         if (mInitialized) {
             mRendererReconfigured = false;
             mRendererReconfigurationState = RECONFIGURATION_STATE.NONE;
             mInputBuffer = null;
             mCSDInfo = null;
             mInitialized = false;
-            mDiscontinuity = false;
         }
     }
 
     @Override
     protected void handleReconfiguration(final DecoderInputBuffer bufferForRead) {
         // For adaptive reconfiguration OMX decoders expect all reconfiguration
         // data to be supplied at the start of the buffer that also contains
         // the first frame in the new format.
@@ -232,24 +221,16 @@ public class GeckoHlsVideoRenderer exten
         }
         mInputStreamEnded = true;
         GeckoHLSSample sample = GeckoHLSSample.EOS;
         calculatDuration(sample);
     }
 
     @Override
     protected void handleSamplePreparation(final DecoderInputBuffer bufferForRead) {
-        if (mDiscontinuity) {
-            // We recently seeked. Drop frames up to the next keyframe.
-            if (!bufferForRead.isKeyFrame()) {
-                return;
-            }
-            mDiscontinuity = false;
-        }
-
         int csdInfoSize = mCSDInfo != null ? mCSDInfo.length : 0;
         int dataSize = bufferForRead.data.limit();
         int size = bufferForRead.isKeyFrame() ? csdInfoSize + dataSize : dataSize;
         byte[] realData = new byte[size];
         if (bufferForRead.isKeyFrame()) {
             // Prepend the CSD information to the sample if it's a key frame.
             System.arraycopy(mCSDInfo, 0, realData, 0, csdInfoSize);
             bufferForRead.data.get(realData, csdInfoSize, dataSize);