Hallo,<br />I'm trying to build a win32 application that launches 2 instances of VLC, and then select only one audio track by muting the unwanted one.<br />To do this I write this small sample that loads in memory libvlc.dll, creates 2 vlc_t structures, puts them on playing (the same file video.mpg),wait for ten seconds and then mutes the first instance.<br />I expect to hear only one audio source(the one coming from the second instance), but this does not happen : in fact, after muting the first audio source, also the second audio source has been muted too (!), I don't hear nothing anymore.<br />How can I do ? What I'm doing wrong ?<br /><br />This is my sample compiled with mingw<br /><br /><br />#include "windows.h"<br />#include "stdio.h"<br />#include "conio.h"<br />#include "string.h"<br />HMODULE p_libvlc;<br />typedef char const *(*P_VLC_COMPILER)();<br />typedef int (*P_VLC_CREATE)();<br />typedef int (*P_VLC_DESTRO
 Y)( int
id);<br />typedef int (*P_VLC_CLEANUP)( int id);<br />typedef int (*P_VLC_INIT)( int id, int n_comm, char **p_block);<br />typedef int (*P_VLC_ADDINTF)( int id, char const *str, int parm1, int parm2);<br />typedef int (*P_VLC_PLAY)( int id);<br />typedef int (*P_VLC_STOP)( int id);<br />typedef int (*P_VLC_PAUSE)( int id);<br />typedef int (*P_VLC_VOLUMESET)(int, int);<br /><br />#define MAX_N_REG 10<br /><br />P_VLC_CREATE VLC_Create;<br />P_VLC_INIT VLC_Init;<br />P_VLC_PLAY VLC_Play;<br />P_VLC_STOP VLC_Stop;<br />P_VLC_DESTROY VLC_Destroy;<br />P_VLC_CLEANUP VLC_Cleanup;<br />P_VLC_VOLUMESET VLC_VolumeSet;<br />P_VLC_PAUSE VLC_Pause;<br /><br /><br />#define N_ARG 7<br /><br />int main( int i_argc, char *ppsz_argv[] )<br />{<br />    int id_vlc1;<br />    int id_vlc2;<br />  int esito=0;<br />        char ch;<br />    char *argomenti[N_ARG];<br />    char arg1[]="a.exe";<br />    char arg2[]="file://video.mpg";<br />    char arg3[]=":width=352";<br /
 >   
char arg4[]=":height=288";<br />    char arg5[80]=":video-x=0";<br />    char arg6[80]=":video-y=0";<br />    char arg7[]="-R";<br /><br />    argomenti[0]=arg1;<br />    argomenti[1]=arg2;<br />    argomenti[2]=arg3;<br />    argomenti[3]=arg4;<br />    argomenti[4]=arg5;<br />    argomenti[5]=arg6;<br />    argomenti[6]=arg7;<br /><br /><br />    p_libvlc = LoadLibrary("libvlc.dll");<br /><br />    if (p_libvlc == NULL) {<br />        printf("rnlibvlc not found");<br />            return(0);<br />  }<br /><br />    VLC_Create=( P_VLC_CREATE)GetProcAddress( p_libvlc,"VLC_Create");<br />    VLC_Init=( P_VLC_INIT)GetProcAddress( p_libvlc,"VLC_Init");<br />    VLC_Destroy=( P_VLC_DESTROY)GetProcAddress( p_libvlc,"VLC_Destroy");<br />    VLC_Play=( P_VLC_PLAY)GetProcAddress( p_libvlc,"VLC_Play");<br />    VLC_Stop=( P_VLC_STOP)GetProcAddress( p_libvlc,"VLC_Stop");<br />    VLC_Clea
 nup=(
P_VLC_CLEANUP)GetProcAddress( p_libvlc,"VLC_CleanUp");<br />    VLC_VolumeSet=( P_VLC_VOLUMESET)GetProcAddress( p_libvlc,"VLC_VolumeSet");<br />    VLC_Pause=( P_VLC_PAUSE)GetProcAddress( p_libvlc,"VLC_Pause");<br /><br /><br />    id_vlc1=(VLC_Create());<br /><br />    esito=(VLC_Init( id_vlc1, N_ARG,argomenti));<br /><br />    if (esito<0){<br />             printf("rnVLC_Init ERROR");<br />        VLC_Destroy( id_vlc1);<br />             return(0);<br />  }<br /><br /><br />    (VLC_Play( id_vlc1));<br /><br />    id_vlc2=(VLC_Create());<br /><br />    sprintf( arg5,":video-x=370");<br />    sprintf( arg6,":video-y=0");<br /><br />    esito=(VLC_Init( id_vlc2, N_ARG,argomenti));<br /><br />    if (esito<0){<br />        printf("rnVLC_Init ERROR");<br />        VLC_Destroy( id_vlc2);<br />        return(0);<br />    }<br /><br /><br />    (VLC_Play( id_vlc2));<br /><br /><br />    Sleep(10000);<br /><br />// NOW I MUTE TH
 E FIRST
INSTANCE BUT AFTER ALSO THE SECOND AUDIO INSTANCE IS MUTED <br />    VLC_VolumeSet( id_vlc1, 0);<br /><br />    Sleep(10000);<br /><br />    VLC_Pause( id_vlc1);<br />    VLC_Stop( id_vlc1);<br />    Sleep(1000);<br /><br />    VLC_Pause( id_vlc2);<br />    VLC_Stop( id_vlc2);<br />    Sleep(1000);<br /><br />    VLC_Cleanup( id_vlc1);<br />    VLC_Destroy( id_vlc1);<br /><br />    VLC_Cleanup( id_vlc2);<br />    VLC_Destroy( id_vlc2);<br /><br />    FreeLibrary( p_libvlc);<br />    Sleep(5000);<br />        return 0;<br />} <br><p><font face=Verdana,Arial size=2>----<br>
 Email.it, the professional e-mail, gratis per te: <a href="http://www.email.it/cgi-bin/start?sid=3" 
 target="_blank" >clicca qui</a> <br>
 <br>
 Sponsor:<br>
 Offerta SKY a 15€ al mese: vedi tutto quello che vuoi tra Mondo, Cinema, Sport e Calcio per una programmazione sempre di altissima qualità direttamente a casa tua!
<br>
 <a href="http://adv.email.it/cgi-bin/foclick.cgi?mid=7781&d=20080416" target="_blank" >Clicca qui</a> </font><br>