Changeset 1307

Show
Ignore:
Timestamp:
12/16/07 10:40:10 (8 months ago)
Author:
aknudsen
Message:

Tweaked error handling in PaOssStream?_Stop

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • portaudio/branches/v19-devel/src/hostapi/oss/pa_unix_oss.c

    r1296 r1307  
    14881488 
    14891489    /* Looks like the only safe way to stop audio without reopening the device is SNDCTL_DSP_POST. 
    1490      * Also disable capture/playback till the stream is started again */ 
     1490     * Also disable capture/playback till the stream is started again. 
     1491     */ 
     1492    int captureErr = 0, playbackErr = 0; 
    14911493    if( stream->capture ) 
    14921494    { 
    1493         ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); 
     1495        if( (captureErr = ioctl( stream->capture->fd, SNDCTL_DSP_POST, 0 )) < 0 ) 
     1496        { 
     1497            PA_DEBUG(( "%s: Failed to stop capture device, error: %d\n", __FUNCTION__, captureErr )); 
     1498        } 
    14941499    } 
    14951500    if( stream->playback && !stream->sharedDevice ) 
    14961501    { 
    1497         ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); 
     1502        if( (playbackErr = ioctl( stream->playback->fd, SNDCTL_DSP_POST, 0 )) < 0 ) 
     1503        { 
     1504            PA_DEBUG(( "%s: Failed to stop playback device, error: %d\n", __FUNCTION__, playbackErr )); 
     1505        } 
     1506    } 
     1507 
     1508    if( captureErr || playbackErr ) 
     1509    { 
     1510        result = paUnanticipatedHostError; 
    14981511    } 
    14991512