we now check if current pipe index is a valid one before trying to close it, seems CloseAudio doesn't check itself

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15646 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2005-12-21 18:22:27 +00:00
parent c6cacf3fb6
commit 4aeaaaae01

@ -166,12 +166,14 @@ echo_stream_set_audioparms(echo_stream *stream, uint8 channels,
LOG(("echo_stream_set_audioparms\n")); LOG(("echo_stream_set_audioparms\n"));
close_params.wPipeIndex = stream->pipe; if (stream->pipe >= 0) {
status = stream->card->pEG->CloseAudio(&close_params); close_params.wPipeIndex = stream->pipe;
if(status!=ECHOSTATUS_OK && status!=ECHOSTATUS_CHANNEL_NOT_OPEN) { status = stream->card->pEG->CloseAudio(&close_params);
PRINT(("echo_stream_set_audioparms : CloseAudio failed\n")); if(status!=ECHOSTATUS_OK && status!=ECHOSTATUS_CHANNEL_NOT_OPEN) {
PRINT((" status: %s \n", pStatusStrs[status])); PRINT(("echo_stream_set_audioparms : CloseAudio failed\n"));
return B_ERROR; PRINT((" status: %s \n", pStatusStrs[status]));
return B_ERROR;
}
} }
open_params.bIsCyclic = TRUE; open_params.bIsCyclic = TRUE;