Bug 856361. Part 10: Address review comments.
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 07 Aug 2013 15:42:43 +1200
changeset 141621 9cc049c10de21891a2ea8225f162936e75f55043
parent 141620 b8f4739d9ff61444d102165ef88b73755be27521
child 141622 df2948e126d121e672b2f2d2b54dd6c966042992
push id32162
push userrocallahan@mozilla.com
push dateWed, 07 Aug 2013 03:41:59 +0000
treeherdermozilla-inbound@9cc049c10de2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs856361
milestone26.0a1
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
Bug 856361. Part 10: Address review comments.
content/media/MediaDecoderStateMachine.cpp
content/media/TrackUnionStream.h
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -615,17 +615,16 @@ void MediaDecoderStateMachine::SendStrea
   DecodedStreamData* stream = mDecoder->GetDecodedStream();
   if (!stream)
     return;
 
   if (mState == DECODER_STATE_DECODING_METADATA)
     return;
 
   if (!mDecoder->IsSameOriginMedia()) {
-    printf("MediaDecoderStateMachine::SendStreamData Same-origin check failed (decoder %p)!!!\n", mDecoder.get());
     return;
   }
 
   // If there's still an audio thread alive, then we can't send any stream
   // data yet since both SendStreamData and the audio thread want to be in
   // charge of popping the audio queue. We're waiting for the audio thread
   // to die before sending anything to our stream.
   if (mAudioThread)
--- a/content/media/TrackUnionStream.h
+++ b/content/media/TrackUnionStream.h
@@ -293,16 +293,21 @@ protected:
         // (now using the fact that inputEnd <= track->GetEndTimeRoundDown() for a non-ended track)
         //   <= TicksToTimeRoundDown(rate, aInputTrack->GetSegment()->GetDuration())/rate
         //   <= rate*aInputTrack->GetSegment()->GetDuration()/rate
         //   = aInputTrack->GetSegment()->GetDuration()
         // as required.
 
         if (inputStartTicks < 0) {
           // Data before the start of the track is just null.
+          // We have to add a small amount of delay to ensure that there is
+          // always a sample available if we see an interval that contains a
+          // tick boundary on the output stream's timeline but does not contain
+          // a tick boundary on the input stream's timeline. 1 tick delay is
+          // necessary and sufficient.
           segment->AppendNullData(-inputStartTicks);
           inputStartTicks = 0;
         }
         if (inputEndTicks > inputStartTicks) {
           segment->AppendSlice(*aInputTrack->GetSegment(),
                                std::min(inputTrackEndPoint, inputStartTicks),
                                std::min(inputTrackEndPoint, inputEndTicks));
         }