vlc - libvlc_media_player_stop 30secondes to return -


i'm using libvlc retrieve raw frame media (rtsp, mjpeg, mp4, avi...) using smem callbacks , playing fine.

but problem when call libvlc_media_player_stop or libvlc_media_player_release freeze program during 30 secondes.

i lot of search , try many workarounds :

make new thread call stop : doesn't solve problem because if want play anew media, mediaplayer still hang in main thread.

call stop main thread not on mouse event : stuck 30 secondes too.

i try different version 2.1.3 lastest git 3.0.0 , problem remain same, how call stop ?

initialisation :

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*)&cbvideoprerender , (long long int)(intptr_t)(void*)&cbvideopostrender , (long long int)(void*)this);  const char * const vlc_args[] = { "-i", "dummy",       "--verbose=0", "--clock-jitter=0", "--no-audio", "--sout", smem_options // stream memory }; mplibvlc = libvlc_new(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args); 

start :

mpmedia = libvlc_media_new_path(mplibvlc, mmediapath.c_str()); mpmediaplayer = libvlc_media_player_new_from_media(mpmedia); libvlc_media_player_play(mpmediaplayer); 

stop :

libvlc_media_player_set_hwnd(mpmediaplayer, null); libvlc_media_release(mpmedia); libvlc_media_player_stop(mpmediaplayer); libvlc_media_player_release(mpmediaplayer); 

i found lot of different issue vlc, that's library wich handle easyly theses media.

so how can call stop without hang ?

thank you.

@serg.v.gusev post old, remember : have respect : - use libvlc_media_player_new_from_media load local files. - use libvlc_media_player_new_from_location connect ip camera.

anyway, in case original video broken, , hanging call stop during theses 30 secs, same code works encoded video files.

ps : moved ffmpeg, both reading , recording video media. little bit more complicated, since vlc based on ffmpeg, have more control, possibility , update...


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -