Page 1 of 1

how to control libvlc_wait to exit?

Posted: 22 Jun 2011 11:22
by allen.li
hi all,

I had been implement a UI by MFC and the UI use vlc library to stream video. (UI=user interface)
Now I got a problem.
When use press a button of UI.
UI will call a function that name is test_thread.
The source code is below.
The test_thread is work but it will stand at libvlc_wait (vlc).
How i can control the libvlc_wait() to exit ??

Code: Select all

UINT test_thread( LPVOID Param ) { //vlc main code vlc = libvlc_new (set, (const char **)argv); if (vlc != NULL) { libvlc_add_intf (vlc, "globalhotkeys,none"); libvlc_add_intf (vlc, NULL); libvlc_playlist_play (vlc, -1, 0, NULL); TRACE("debug 4 \n"); for(int d=0;d<256;d++){ if(argv[d]!=0){ free(argv[d]); } } libvlc_wait (vlc); libvlc_release (vlc); }

Re: how to control libvlc_wait to exit?

Posted: 22 Jun 2011 12:01
by Rémi Denis-Courmont
It triggers on libvlc_Quit().

Re: how to control libvlc_wait to exit?

Posted: 22 Jun 2011 12:54
by allen.li
Thank your answer,but compile can't found libvlc_Quit() because it isn't define in libvlc.h file.

In vlc1.1.9 sdk, The API only define below file,

#include <vlc/libvlc_structures.h>
#include <vlc/libvlc.h>
#include <vlc/libvlc_media.h>
#include <vlc/libvlc_media_player.h>
#include <vlc/libvlc_media_list.h>
#include <vlc/libvlc_media_list_player.h>
#include <vlc/libvlc_media_library.h>
#include <vlc/libvlc_media_discoverer.h>
#include <vlc/libvlc_events.h>
#include <vlc/libvlc_vlm.h>
#include <vlc/deprecated.h>

Re: how to control libvlc_wait to exit?

Posted: 22 Jun 2011 13:16
by Rémi Denis-Courmont
Of course. It's in the internal API.

Re: how to control libvlc_wait to exit?

Posted: 22 Jun 2011 13:23
by allen.li
Should I write a interface to call libvlc_Quit()??

Re: how to control libvlc_wait to exit?

Posted: 22 Jun 2011 21:29
by Rémi Denis-Courmont
I don't see the point.

Re: how to control libvlc_wait to exit?

Posted: 23 Jun 2011 04:36
by allen.li
please help me!!!

Re: how to control libvlc_wait to exit?

Posted: 23 Jun 2011 10:51
by Rémi Denis-Courmont
If you don't have access to libvlc_Quit(), calling libvlc_wait() simply makes no sense. Don't do that.