Backed out changeset 87880c0f7336 (bug 1300703) on request from jya
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 07 Sep 2016 14:14:31 +0200
changeset 313056 7361e1768b80b32d7e48140687027e70f25a6c55
parent 313055 f0df0335a0497383aa3ac8886855f73e870c2db8
child 313057 22cea8abf7e408bf742b3f1d97049bb99a3ac440
push id20479
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 01:08:46 +0000
treeherderfx-team@fb7c6b034329 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1300703
milestone51.0a1
backs out87880c0f7336cae145e4e867aa3b68eff9896ba3
Backed out changeset 87880c0f7336 (bug 1300703) on request from jya
dom/media/webm/WebMDemuxer.cpp
dom/media/webm/WebMDemuxer.h
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -350,23 +350,16 @@ WebMDemuxer::ReadMetadata()
       // ensures that our video frame creation code doesn't overflow.
       nsIntSize displaySize(params.display_width, params.display_height);
       nsIntSize frameSize(params.width, params.height);
       if (!IsValidVideoRegion(frameSize, pictureRect, displaySize)) {
         // Video track's frame sizes will overflow. Ignore the video track.
         continue;
       }
 
-      uint64_t defaultDuration;
-      r = nestegg_track_default_duration(context, track, &defaultDuration);
-      if (r >= 0) {
-        mVideoDefaultDuration =
-          Some(uint64_t(media::TimeUnit::FromNanoseconds(defaultDuration).ToMicroseconds()));
-      }
-
       mVideoTrack = track;
       mHasVideo = true;
 
       mInfo.mVideo.mDisplay = displaySize;
       mInfo.mVideo.mImage = frameSize;
       mInfo.mVideo.SetImageRect(pictureRect);
 
       switch (params.stereo_mode) {
@@ -397,23 +390,16 @@ WebMDemuxer::ReadMetadata()
       }
     } else if (type == NESTEGG_TRACK_AUDIO && !mHasAudio) {
       nestegg_audio_params params;
       r = nestegg_track_audio_params(context, track, &params);
       if (r == -1) {
         return NS_ERROR_FAILURE;
       }
 
-      uint64_t defaultDuration;
-      r = nestegg_track_default_duration(context, track, &defaultDuration);
-      if (r >= 0) {
-        mAudioDefaultDuration =
-          Some(uint64_t(media::TimeUnit::FromNanoseconds(defaultDuration).ToMicroseconds()));
-      }
-
       mAudioTrack = track;
       mHasAudio = true;
       mAudioCodec = nestegg_track_codec_id(context, track);
       if (mAudioCodec == NESTEGG_CODEC_VORBIS) {
         mInfo.mAudio.mMimeType = "audio/webm; codecs=vorbis";
       } else if (mAudioCodec == NESTEGG_CODEC_OPUS) {
         mInfo.mAudio.mMimeType = "audio/webm; codecs=opus";
         OpusDataDecoder::AppendCodecDelay(mInfo.mAudio.mCodecSpecificConfig,
@@ -596,40 +582,32 @@ WebMDemuxer::GetNextPacket(TrackInfo::Tr
     if (next_holder) {
       next_tstamp = next_holder->Timestamp();
       PushAudioPacket(next_holder);
     } else if (duration >= 0) {
       next_tstamp = tstamp + duration;
     } else if (!mIsMediaSource ||
                (mIsMediaSource && mLastAudioFrameTime.isSome())) {
       next_tstamp = tstamp;
-      if (mAudioDefaultDuration.isSome()) {
-        next_tstamp += mAudioDefaultDuration.ref();
-      } else {
-        next_tstamp += tstamp - mLastAudioFrameTime.refOr(0);
-      }
+      next_tstamp += tstamp - mLastAudioFrameTime.refOr(0);
     } else {
       PushAudioPacket(holder);
     }
     mLastAudioFrameTime = Some(tstamp);
   } else if (aType == TrackInfo::kVideoTrack) {
     RefPtr<NesteggPacketHolder> next_holder(NextPacket(aType));
     if (next_holder) {
       next_tstamp = next_holder->Timestamp();
       PushVideoPacket(next_holder);
     } else if (duration >= 0) {
       next_tstamp = tstamp + duration;
     } else if (!mIsMediaSource ||
                (mIsMediaSource && mLastVideoFrameTime.isSome())) {
       next_tstamp = tstamp;
-      if (mVideoDefaultDuration.isSome()) {
-        next_tstamp += mVideoDefaultDuration.ref();
-      } else {
-        next_tstamp += tstamp - mLastVideoFrameTime.refOr(0);
-      }
+      next_tstamp += tstamp - mLastVideoFrameTime.refOr(0);
     } else {
       PushVideoPacket(holder);
     }
     mLastVideoFrameTime = Some(tstamp);
   }
 
   if (mIsMediaSource && next_tstamp == INT64_MIN) {
     return false;
--- a/dom/media/webm/WebMDemuxer.h
+++ b/dom/media/webm/WebMDemuxer.h
@@ -215,18 +215,16 @@ private:
 
   // Nanoseconds to discard after seeking.
   uint64_t mSeekPreroll;
 
   // Calculate the frame duration from the last decodeable frame using the
   // previous frame's timestamp.  In NS.
   Maybe<int64_t> mLastAudioFrameTime;
   Maybe<int64_t> mLastVideoFrameTime;
-  Maybe<uint64_t> mAudioDefaultDuration;
-  Maybe<uint64_t> mVideoDefaultDuration;
 
   // Codec ID of audio track
   int mAudioCodec;
   // Codec ID of video track
   int mVideoCodec;
 
   // Booleans to indicate if we have audio and/or video data
   bool mHasVideo;