I think this change fixed some trouble I had with MediaPlayer on a system
with an unsupported sound card or the like, the fSoundOutput initialization is checked in more places. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23764 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -886,7 +886,7 @@ printf("audio format changed, new buffer duration %Ld\n", bufferDuration);
|
|||||||
|
|
||||||
// TODO: fix performance time update (in case no audio)
|
// TODO: fix performance time update (in case no audio)
|
||||||
if (fTimeSourceLock.Lock()) {
|
if (fTimeSourceLock.Lock()) {
|
||||||
audioLatency = fSoundOutput->Latency();
|
audioLatency = fSoundOutput ? fSoundOutput->Latency() : 0;
|
||||||
fTimeSourceSysTime = system_time() + audioLatency - bufferDuration;
|
fTimeSourceSysTime = system_time() + audioLatency - bufferDuration;
|
||||||
fTimeSourcePerfTime = buffer->startTime;
|
fTimeSourcePerfTime = buffer->startTime;
|
||||||
fTimeSourceLock.Unlock();
|
fTimeSourceLock.Unlock();
|
||||||
@@ -895,7 +895,8 @@ printf("audio format changed, new buffer duration %Ld\n", bufferDuration);
|
|||||||
// fTimeSourcePerfTime);
|
// fTimeSourcePerfTime);
|
||||||
|
|
||||||
if (fSoundOutput) {
|
if (fSoundOutput) {
|
||||||
fSoundOutput->Play(buffer->buffer, buffer->sizeUsed);
|
if (fSoundOutput->InitCheck() >= B_OK)
|
||||||
|
fSoundOutput->Play(buffer->buffer, buffer->sizeUsed);
|
||||||
_UpdatePosition(buffer->startTime);
|
_UpdatePosition(buffer->startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1048,6 +1049,7 @@ printf("video decode start\n");
|
|||||||
fTimeSourceLock.Unlock();
|
fTimeSourceLock.Unlock();
|
||||||
} else {
|
} else {
|
||||||
// puhh...
|
// puhh...
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1220,7 +1222,8 @@ Controller::_UpdatePosition(bigtime_t position, bool isVideoPosition, bool force
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// prefer audio position over video position
|
// prefer audio position over video position
|
||||||
if (isVideoPosition && fAudioSupplier)
|
if (isVideoPosition && (fAudioSupplier && fSoundOutput
|
||||||
|
&& fSoundOutput->InitCheck() >= B_OK))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// BAutolock _(fTimeSourceLock);
|
// BAutolock _(fTimeSourceLock);
|
||||||
|
|||||||
Reference in New Issue
Block a user