зеркало из https://github.com/mozilla/gecko-dev.git
Bug 515552 - Enable in-monitor assertions in nsOggDecoder. r=chris.double
--HG-- extra : rebase_source : c494f75bd7cc1cf4b114b9ff497412fb1e3c1ce1
This commit is contained in:
Родитель
ce3025f762
Коммит
7518dee43b
|
@ -291,7 +291,7 @@ public:
|
|||
PRBool HasAudio()
|
||||
{
|
||||
NS_ASSERTION(mState > DECODER_STATE_DECODING_METADATA, "HasAudio() called during invalid state");
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "HasAudio() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
return mAudioTrack != -1;
|
||||
}
|
||||
|
||||
|
@ -974,7 +974,7 @@ void nsOggDecodeStateMachine::PlayFrame() {
|
|||
|
||||
void nsOggDecodeStateMachine::PlayVideo(FrameData* aFrame)
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "PlayVideo() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
if (aFrame && aFrame->mVideoHeader) {
|
||||
OggPlayVideoData* videoData = oggplay_callback_info_get_video_data(aFrame->mVideoHeader);
|
||||
|
||||
|
@ -1009,7 +1009,7 @@ void nsOggDecodeStateMachine::PlayVideo(FrameData* aFrame)
|
|||
|
||||
void nsOggDecodeStateMachine::PlayAudio(FrameData* aFrame)
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "PlayAudio() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
if (!mAudioStream)
|
||||
return;
|
||||
|
||||
|
@ -1018,7 +1018,7 @@ void nsOggDecodeStateMachine::PlayAudio(FrameData* aFrame)
|
|||
|
||||
void nsOggDecodeStateMachine::OpenAudioStream()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "OpenAudioStream() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
mAudioStream = new nsAudioStream();
|
||||
if (!mAudioStream) {
|
||||
LOG(PR_LOG_ERROR, ("Could not create audio stream"));
|
||||
|
@ -1031,7 +1031,7 @@ void nsOggDecodeStateMachine::OpenAudioStream()
|
|||
|
||||
void nsOggDecodeStateMachine::CloseAudioStream()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "CloseAudioStream() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
if (mAudioStream) {
|
||||
mAudioStream->Shutdown();
|
||||
mAudioStream = nsnull;
|
||||
|
@ -1040,7 +1040,7 @@ void nsOggDecodeStateMachine::CloseAudioStream()
|
|||
|
||||
void nsOggDecodeStateMachine::StartAudio()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "StartAudio() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
if (HasAudio()) {
|
||||
OpenAudioStream();
|
||||
}
|
||||
|
@ -1048,7 +1048,7 @@ void nsOggDecodeStateMachine::StartAudio()
|
|||
|
||||
void nsOggDecodeStateMachine::StopAudio()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "StopAudio() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
if (HasAudio()) {
|
||||
CloseAudioStream();
|
||||
}
|
||||
|
@ -1056,7 +1056,7 @@ void nsOggDecodeStateMachine::StopAudio()
|
|||
|
||||
void nsOggDecodeStateMachine::StartPlayback()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "StartPlayback() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
StartAudio();
|
||||
mPlaying = PR_TRUE;
|
||||
|
||||
|
@ -1078,7 +1078,7 @@ void nsOggDecodeStateMachine::StartPlayback()
|
|||
|
||||
void nsOggDecodeStateMachine::StopPlayback()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "StopPlayback() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
mLastFrame = mDecodedFrames.ResetTimes(mCallbackPeriod);
|
||||
StopAudio();
|
||||
mPlaying = PR_FALSE;
|
||||
|
@ -1133,7 +1133,7 @@ void nsOggDecodeStateMachine::UpdatePlaybackPosition(float aTime)
|
|||
|
||||
void nsOggDecodeStateMachine::QueueDecodedFrames()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "QueueDecodedFrames() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
FrameData* frame;
|
||||
while (!mDecodedFrames.IsFull() && (frame = NextFrame())) {
|
||||
if (mDecodedFrames.GetCount() < 2) {
|
||||
|
@ -1152,13 +1152,13 @@ void nsOggDecodeStateMachine::QueueDecodedFrames()
|
|||
|
||||
void nsOggDecodeStateMachine::ClearPositionChangeFlag()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "ClearPositionChangeFlag() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
mPositionChangeQueued = PR_FALSE;
|
||||
}
|
||||
|
||||
void nsOggDecodeStateMachine::SetVolume(float volume)
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "SetVolume() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
if (mAudioStream) {
|
||||
mAudioStream->SetVolume(volume);
|
||||
}
|
||||
|
@ -1168,25 +1168,25 @@ void nsOggDecodeStateMachine::SetVolume(float volume)
|
|||
|
||||
float nsOggDecodeStateMachine::GetCurrentTime()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "GetCurrentTime() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
return mCurrentFrameTime;
|
||||
}
|
||||
|
||||
PRInt64 nsOggDecodeStateMachine::GetDuration()
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "GetDuration() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
return mDuration;
|
||||
}
|
||||
|
||||
void nsOggDecodeStateMachine::SetDuration(PRInt64 aDuration)
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "SetDuration() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
mDuration = aDuration;
|
||||
}
|
||||
|
||||
void nsOggDecodeStateMachine::SetSeekable(PRBool aSeekable)
|
||||
{
|
||||
// NS_ASSERTION(PR_InMonitor(mDecoder->GetMonitor()), "SetSeekable() called without acquiring decoder monitor");
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mDecoder->GetMonitor());
|
||||
mSeekable = aSeekable;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче