gentle patches to continue on with echo_stream_set_audioparms if we can not close the channel. also, use MakePipeIndex to give us some more reasonable pipe indices. (fix for record pipe number) VerifyAudioOpen after we open the stream, right now we fail there. :-(

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6507 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2004-02-06 08:42:19 +00:00
parent 7a0db1a3bc
commit 2eabcdebe7

View File

@ -137,7 +137,7 @@ echo_stream_set_audioparms(echo_stream *stream, uint8 channels,
close_params.wPipeIndex = stream->pipe;
status = stream->card->pEG->CloseAudio(&close_params);
if(status!=ECHOSTATUS_OK) {
if(status!=ECHOSTATUS_OK && status!=ECHOSTATUS_CHANNEL_NOT_OPEN) {
PRINT(("echo_stream_set_audioparms : CloseAudio failed\n"));
PRINT(("  status: %s \n", pStatusStrs[status]));
return B_ERROR;
@ -154,6 +154,13 @@ echo_stream_set_audioparms(echo_stream *stream, uint8 channels,
PRINT(("  status: %s \n", pStatusStrs[status]));
return B_ERROR;
}
status = stream->card->pEG->VerifyAudioOpen(stream->pipe);
if(status!=ECHOSTATUS_OK) {
PRINT(("echo_stream_set_audioparms : VerifyAudioOpen failed\n"));
PRINT(("  status: %s \n", pStatusStrs[status]));
return B_ERROR;
}
if ((stream->channels == channels) &&
(stream->b16 == b16) &&
@ -314,7 +321,7 @@ echo_stream_new(echo_dev *card, uint8 use, uint32 bufframes, uint8 bufcount)
stream->trigblk = 0;
stream->blkmod = 0;
stream->pipe = 0;
stream->pipe = card->pEG->MakePipeIndex(0, (use == ECHO_USE_RECORD));
stream->frames_count = 0;
stream->real_time = 0;