From 2eabcdebe7f88be603e4c7ebff9be395c9996ffe Mon Sep 17 00:00:00 2001 From: shatty Date: Fri, 6 Feb 2004 08:42:19 +0000 Subject: [PATCH] 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 --- src/add-ons/kernel/drivers/audio/echo/echo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/drivers/audio/echo/echo.cpp b/src/add-ons/kernel/drivers/audio/echo/echo.cpp index f3cb82e140..c4cf40e4a5 100644 --- a/src/add-ons/kernel/drivers/audio/echo/echo.cpp +++ b/src/add-ons/kernel/drivers/audio/echo/echo.cpp @@ -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;