Commit 9e76d92b authored by Simon Morlat's avatar Simon Morlat
Browse files

fix bad characters in card descriptions

parent e0cf802a
...@@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software ...@@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#define UNICODE
#include "mediastreamer2/mssndcard.h" #include "mediastreamer2/mssndcard.h"
#include "mediastreamer2/msfilter.h" #include "mediastreamer2/msfilter.h"
#include "mediastreamer2/msticker.h" #include "mediastreamer2/msticker.h"
...@@ -168,43 +170,41 @@ static void add_or_update_card(MSSndCardManager *m, const char *name, int indev, ...@@ -168,43 +170,41 @@ static void add_or_update_card(MSSndCardManager *m, const char *name, int indev,
} }
static void winsndcard_detect(MSSndCardManager *m){ static void winsndcard_detect(MSSndCardManager *m){
MMRESULT mr = NOERROR; MMRESULT mr = NOERROR;
unsigned int nOutDevices = waveOutGetNumDevs (); unsigned int nOutDevices = waveOutGetNumDevs ();
unsigned int nInDevices = waveInGetNumDevs (); unsigned int nInDevices = waveInGetNumDevs ();
unsigned int item; unsigned int item;
char card[256]={0};
if (nOutDevices>nInDevices)
if (nOutDevices>nInDevices)
nInDevices = nOutDevices; nInDevices = nOutDevices;
for (item = 0; item < nInDevices; item++){ for (item = 0; item < nInDevices; item++){
WAVEINCAPS incaps;
WAVEINCAPS incaps; WAVEOUTCAPS outcaps;
WAVEOUTCAPS outcaps; mr = waveInGetDevCaps (item, &incaps, sizeof (WAVEINCAPS));
mr = waveInGetDevCaps (item, &incaps, sizeof (WAVEINCAPS)); if (mr == MMSYSERR_NOERROR)
if (mr == MMSYSERR_NOERROR) {
{
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
char card[256];
snprintf(card, sizeof(card), "Input card %i", item); snprintf(card, sizeof(card), "Input card %i", item);
add_or_update_card(m,card,item,-1,MS_SND_CARD_CAP_CAPTURE);
/* _tprintf(L"new card: %s", incaps.szPname); */
#else #else
add_or_update_card(m,incaps.szPname,item,-1,MS_SND_CARD_CAP_CAPTURE); WideCharToMultiByte(CP_UTF8,0,incaps.szPname,-1
,card,sizeof(card)-1,NULL,NULL);
#endif #endif
add_or_update_card(m,card,item,-1,MS_SND_CARD_CAP_CAPTURE);
} }
mr = waveOutGetDevCaps (item, &outcaps, sizeof (WAVEOUTCAPS)); mr = waveOutGetDevCaps (item, &outcaps, sizeof (WAVEOUTCAPS));
if (mr == MMSYSERR_NOERROR) if (mr == MMSYSERR_NOERROR)
{ {
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
char card[256];
snprintf(card, sizeof(card), "Output card %i", item); snprintf(card, sizeof(card), "Output card %i", item);
add_or_update_card(m,card,-1,item,MS_SND_CARD_CAP_PLAYBACK);
/* _tprintf(L"new card: %s", outcaps.szPname); */
#else #else
add_or_update_card(m,outcaps.szPname,-1,item,MS_SND_CARD_CAP_PLAYBACK); WideCharToMultiByte(CP_UTF8,0,outcaps.szPname,-1
,card,sizeof(card)-1,NULL,NULL);
#endif #endif
add_or_update_card(m,card,-1,item,MS_SND_CARD_CAP_PLAYBACK);
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment