Commit 68bcb6a4 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

vlc: Make sure we call libvlc_release() when we are requested to die.

Note: I don't think we did yet match the old behaviour, if we hit ctrl-c while in libvlc_new(), vlc isn't killed properly.
parent 31013e29
...@@ -56,6 +56,9 @@ extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron, ...@@ -56,6 +56,9 @@ extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron,
static void *SigHandler (void *set); static void *SigHandler (void *set);
#endif #endif
/* running vlc instance */
static libvlc_instance_t * vlc = NULL;
/***************************************************************************** /*****************************************************************************
* main: parse command line, start interface and spawn threads. * main: parse command line, start interface and spawn threads.
*****************************************************************************/ *****************************************************************************/
...@@ -184,7 +187,7 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -184,7 +187,7 @@ int main( int i_argc, const char *ppsz_argv[] )
libvlc_exception_init (&ex); libvlc_exception_init (&ex);
/* Initialize libvlc */ /* Initialize libvlc */
libvlc_instance_t *vlc = libvlc_new (i_argc, ppsz_argv, &ex); vlc = libvlc_new (i_argc, ppsz_argv, &ex);
if (vlc != NULL) if (vlc != NULL)
{ {
libvlc_run_interface (vlc, NULL, &ex); libvlc_run_interface (vlc, NULL, &ex);
...@@ -252,7 +255,7 @@ static void *SigHandler (void *data) ...@@ -252,7 +255,7 @@ static void *SigHandler (void *data)
fprintf (stderr, "signal %d received, terminating vlc - do it " fprintf (stderr, "signal %d received, terminating vlc - do it "
"again quickly in case it gets stuck\n", i_signal); "again quickly in case it gets stuck\n", i_signal);
//VLC_Die( 0 ); if (vlc) libvlc_release( vlc );
} }
else /* time (NULL) <= abort_time */ else /* time (NULL) <= abort_time */
{ {
......
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