- Timestamp:
- Feb 14, 2006 9:08:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.c
r65 r183 106 106 #include <windows.h> 107 107 #include <mmsystem.h> 108 #ifndef UNDER_CE 108 109 #include <process.h> 110 #endif 109 111 #include <assert.h> 110 112 /* PLB20010422 - "memory.h" doesn't work on CodeWarrior for PC. Thanks Mike Berry for the mod. */ … … 125 127 #include "pa_win_wmme.h" 126 128 127 #if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ 129 #include <pj/string.h> 130 #include <pj/unicode.h> 131 132 #if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) && \ 133 !defined(UNDER_CE) 134 /* MSC version 6 and above */ 128 135 #pragma comment(lib, "winmm.lib") 129 136 #endif … … 160 167 #define PA_MME_MIN_TIMEOUT_MSEC_ (1000) 161 168 162 static const char constInputMapperSuffix_[] = " - Input";163 static const char constOutputMapperSuffix_[] = " - Output";169 static const pj_char_t constInputMapperSuffix_[] = PJ_T(" - Input"); 170 static const pj_char_t constOutputMapperSuffix_[] = PJ_T(" - Output"); 164 171 165 172 /********************************************************************/ … … 553 560 WAVEINCAPS wic; 554 561 PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; 562 PJ_DECL_ANSI_TEMP_BUF(abuf,128) 555 563 556 564 *success = 0; … … 575 583 { 576 584 /* Append I/O suffix to WAVE_MAPPER device. */ 577 deviceName = (char *)PaUtil_GroupAllocateMemory( 578 winMmeHostApi->allocations, strlen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); 585 deviceName = (char*)PaUtil_GroupAllocateMemory( 586 winMmeHostApi->allocations, 587 pj_native_strlen( wic.szPname ) + sizeof(pj_char_t) + sizeof(constInputMapperSuffix_) ); 579 588 if( !deviceName ) 580 589 { … … 582 591 goto error; 583 592 } 584 strcpy( deviceName, wic.szPname);585 strcat( deviceName, constInputMapperSuffix_);593 strcpy( deviceName, PJ_NATIVE_TO_STRING(wic.szPname,abuf,sizeof(abuf)) ); 594 strcat( deviceName, PJ_NATIVE_TO_STRING(constInputMapperSuffix_,abuf,sizeof(abuf)) ); 586 595 } 587 596 else 588 597 { 589 598 deviceName = (char*)PaUtil_GroupAllocateMemory( 590 winMmeHostApi->allocations, strlen( wic.szPname ) + 1);599 winMmeHostApi->allocations, pj_native_strlen( wic.szPname ) + sizeof(pj_char_t) ); 591 600 if( !deviceName ) 592 601 { … … 594 603 goto error; 595 604 } 596 strcpy( deviceName, wic.szPname);605 strcpy( deviceName, PJ_NATIVE_TO_STRING(wic.szPname,abuf,sizeof(abuf)) ); 597 606 } 598 607 deviceInfo->name = deviceName; … … 629 638 WAVEOUTCAPS woc; 630 639 PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; 640 PJ_DECL_ANSI_TEMP_BUF(abuf,128) 631 641 632 642 *success = 0; … … 652 662 /* Append I/O suffix to WAVE_MAPPER device. */ 653 663 deviceName = (char *)PaUtil_GroupAllocateMemory( 654 winMmeHostApi->allocations, strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) );664 winMmeHostApi->allocations, pj_native_strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); 655 665 if( !deviceName ) 656 666 { … … 658 668 goto error; 659 669 } 660 strcpy( deviceName, woc.szPname);661 strcat( deviceName, constOutputMapperSuffix_);670 strcpy( deviceName, PJ_NATIVE_TO_STRING(woc.szPname,abuf,sizeof(abuf)) ); 671 strcat( deviceName, PJ_NATIVE_TO_STRING(constOutputMapperSuffix_,abuf,sizeof(abuf)) ); 662 672 } 663 673 else 664 674 { 665 675 deviceName = (char*)PaUtil_GroupAllocateMemory( 666 winMmeHostApi->allocations, strlen( woc.szPname ) + 1 );676 winMmeHostApi->allocations, pj_native_strlen( woc.szPname ) + 1 ); 667 677 if( !deviceName ) 668 678 { … … 670 680 goto error; 671 681 } 672 strcpy( deviceName, woc.szPname);682 strcpy( deviceName, PJ_NATIVE_TO_STRING(woc.szPname,abuf,sizeof(abuf)) ); 673 683 } 674 684 deviceInfo->name = deviceName;
Note: See TracChangeset
for help on using the changeset viewer.