title: libvlc_media_player_stop 30secondes to return
body: <p>I'm using libvlc to retrieve raw frame from any media (rtsp, mjpeg, mp4, avi...) by using smem callbacks and everything is playing fine.</p>
  
  <p>But my problem is that when i call libvlc_media_player_stop or libvlc_media_player_release it just freeze my program during 30 secondes.</p>
  
  <p>I do a lot of search and try many workarounds :</p>
  
  <p>Make a new thread to call the stop : doesn't solve my problem because if i want to play anew the media, the mediaplayer still hang in the main thread.</p>
  
  <p>Call stop from the main thread not on the mouse event : stuck 30 secondes too.</p>
  
  <p>I try different version from 2.1.3 to lastest git 3.0.0 and the problem remain the same, so how do you call this stop ?</p>
  
  <p>Initialisation :</p>
  
  <pre><code>char smem_options[1000];
  sprintf(smem_options
  , "#transcode{vcodec=RV24}:smem{"
  "video-prerender-callback=%lld,"
  "video-postrender-callback=%lld,"
  "video-data=%lld},"
  , (long long int)(intptr_t)(void*)&amp;cbVideoPrerender
  , (long long int)(intptr_t)(void*)&amp;cbVideoPostrender
  , (long long int)(void*)this);
  
  const char * const vlc_args[] = {
  "-I", "dummy",      
  "--verbose=0",
  "--clock-jitter=0",
  "--no-audio",
  "--sout", smem_options // Stream to memory
  };
  mpLibVlc = libvlc_new(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);
  </code></pre>
  
  <p>Start :</p>
  
  <pre><code>mpMedia = libvlc_media_new_path(mpLibVlc, mMediaPath.c_str());
  mpMediaPlayer = libvlc_media_player_new_from_media(mpMedia);
  libvlc_media_player_play(mpMediaPlayer);
  </code></pre>
  
  <p>Stop :</p>
  
  <pre><code>libvlc_media_player_set_hwnd(mpMediaPlayer, NULL);
  libvlc_media_release(mpMedia);
  libvlc_media_player_stop(mpMediaPlayer);
  libvlc_media_player_release(mpMediaPlayer);
  </code></pre>
  
  <p>I found a lot of different issue with vlc, but that's the only library wich handle easyly all theses media.</p>
  
  <p>So how can i call this stop without any hang ?</p>
  
  <p>Thank you.</p>