Ignore:
Timestamp:
Mar 15, 2006 8:56:04 PM (18 years ago)
Author:
bennylp
Message:

Tidying up sound device, register PortAudio? error codes, and initial support for stereo sound device (untested)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/errno.c

    r315 r319  
    1919#include <pjmedia/errno.h> 
    2020#include <pj/string.h> 
     21#include <portaudio.h> 
    2122 
    2223 
     
    130131    pj_str_t errstr; 
    131132 
    132     if (statcode >= PJMEDIA_ERRNO_START &&  
    133         statcode < PJMEDIA_ERRNO_START + PJ_ERRNO_SPACE_SIZE) 
     133    /* See if the error comes from PortAudio. */ 
     134    if (statcode >= PJMEDIA_ERRNO_FROM_PORTAUDIO(paNotInitialized) && 
     135        statcode <  PJMEDIA_ERRNO_FROM_PORTAUDIO(paNotInitialized + 10000)) 
     136    { 
     137 
     138        int pa_err = statcode - PJMEDIA_ERRNO_FROM_PORTAUDIO(0); 
     139        pj_str_t msg; 
     140         
     141        msg.ptr = (char*)Pa_GetErrorText(pa_err); 
     142        msg.slen = pj_ansi_strlen(msg.ptr); 
     143 
     144        errstr.ptr = buf; 
     145        pj_strncpy_with_null(&errstr, &msg, bufsize); 
     146        return errstr; 
     147 
     148    } else if (statcode >= PJMEDIA_ERRNO_START &&  
     149               statcode < PJMEDIA_ERRNO_START + PJ_ERRNO_SPACE_SIZE) 
    134150    { 
    135151        /* Find the error in the table. 
Note: See TracChangeset for help on using the changeset viewer.