Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1100803 - Re-create a decoded media stream if necessary. r=roc
Browse files Browse the repository at this point in the history
  • Loading branch information
alastor0325 committed Dec 15, 2014
1 parent 1973c34 commit 82666af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions dom/media/MediaDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ MediaDecoder::DecodedStreamGraphListener::NotifyEvent(MediaStreamGraph* aGraph,
aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
}
}

void MediaDecoder::RecreateDecodedStreamIfNecessary(int64_t aStartTimeUSecs)
{
if (mInitialAudioCaptured) {
RecreateDecodedStream(aStartTimeUSecs);
}
}

void MediaDecoder::DestroyDecodedStream()
{
MOZ_ASSERT(NS_IsMainThread());
Expand Down
3 changes: 3 additions & 0 deletions dom/media/MediaDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,9 @@ class MediaDecoder : public nsIObserver,
// The decoder monitor must be held.
bool IsLogicallyPlaying();

// Re-create a decoded stream if audio being captured
void RecreateDecodedStreamIfNecessary(int64_t aStartTimeUSecs);

#ifdef MOZ_EME
// This takes the decoder monitor.
virtual nsresult SetCDMProxy(CDMProxy* aProxy) MOZ_OVERRIDE;
Expand Down
4 changes: 1 addition & 3 deletions dom/media/MediaDecoderStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1624,9 +1624,7 @@ MediaDecoderStateMachine::StartSeek(const SeekTarget& aTarget)

DECODER_LOG("Changed state to SEEKING (to %lld)", mSeekTarget.mTime);
SetState(DECODER_STATE_SEEKING);
if (mDecoder->GetDecodedStream()) {
mDecoder->RecreateDecodedStream(seekTime - mStartTime);
}
mDecoder->RecreateDecodedStreamIfNecessary(seekTime - mStartTime);
ScheduleStateMachine();
}

Expand Down

0 comments on commit 82666af

Please sign in to comment.