[vlc-devel] libvlc and java swt application crashing fix

Aswin Thoudam aswinthou at gmail.com
Wed Feb 24 11:29:27 CET 2016


Hi,

I am creating a surface in java SWT and using the window id created by the
java application I used vlc to play the video on the surface. On stopping
of video playback and attempting to dispose the window my application
sometimes crashes. This due to faulty implementation by either by SWT or
vlc or xcb. After checking the various logs I saw that on some situation
vlc loads xcb-window and on other time another window type is created.
Further I saw that if xcb_glx is used then my java application never
crashes. Also I am using vlc-2.2.1 on a RHEL 6.6 and sometimes on core i3
processor with 2 real core and 2 simulated core for a total of 4 core
hardware acceleration seems to have a bad effect with no video output
although audio output is heard sometime. So I made the following changes by
patching the file media_player.c with the following patch and found my
application is working fine. The patch I am submitting now

diff -crB vlc-2.2.1-orig/lib/media_player.c vlc-2.2.1/lib/media_player.c
*** vlc-2.2.1-orig/lib/media_player.c    2015-01-17 13:20:50.000000000 +0530
--- vlc-2.2.1/lib/media_player.c    2015-08-21 18:59:31.000000000 +0530
***************
*** 938,945 ****
      assert (p_mi != NULL);

!     var_SetString (p_mi, "avcodec-hw", "");
!     var_SetString (p_mi, "vout", drawable ? "xid" : "any");
!     var_SetString (p_mi, "window", drawable ? "embed-xid,any" : "any");
      var_SetInteger (p_mi, "drawable-xid", drawable);
  }

--- 938,945 ----
      assert (p_mi != NULL);

!     var_SetString (p_mi, "avcodec-hw", "none");
!     var_SetString (p_mi, "vout", drawable ? "xcb_glx,any" : "any");
!     var_SetString (p_mi, "window", drawable ? "any" : "any");
      var_SetInteger (p_mi, "drawable-xid", drawable);
  }

Aswin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160224/a8a84b55/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: java-vlc.patch
Type: application/octet-stream
Size: 817 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160224/a8a84b55/attachment.obj>


More information about the vlc-devel mailing list