how to control libvlc_wait to exit?

This forum is about all development around libVLC.
allen.li
New Cone
New Cone
Posts: 6
Joined: 18 May 2011 13:54

how to control libvlc_wait to exit?

Postby allen.li » 22 Jun 2011 11:22

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); }

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: how to control libvlc_wait to exit?

Postby Rémi Denis-Courmont » 22 Jun 2011 12:01

It triggers on libvlc_Quit().
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

allen.li
New Cone
New Cone
Posts: 6
Joined: 18 May 2011 13:54

Re: how to control libvlc_wait to exit?

Postby allen.li » 22 Jun 2011 12:54

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>

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: how to control libvlc_wait to exit?

Postby Rémi Denis-Courmont » 22 Jun 2011 13:16

Of course. It's in the internal API.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

allen.li
New Cone
New Cone
Posts: 6
Joined: 18 May 2011 13:54

Re: how to control libvlc_wait to exit?

Postby allen.li » 22 Jun 2011 13:23

Should I write a interface to call libvlc_Quit()??

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: how to control libvlc_wait to exit?

Postby Rémi Denis-Courmont » 22 Jun 2011 21:29

I don't see the point.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

allen.li
New Cone
New Cone
Posts: 6
Joined: 18 May 2011 13:54

Re: how to control libvlc_wait to exit?

Postby allen.li » 23 Jun 2011 04:36

please help me!!!

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: how to control libvlc_wait to exit?

Postby Rémi Denis-Courmont » 23 Jun 2011 10:51

If you don't have access to libvlc_Quit(), calling libvlc_wait() simply makes no sense. Don't do that.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests