[SOLVED]DetachCurrentThread not called

VLC for Android and Chrome OS specific usage questions
valentin J
New Cone
New Cone
Posts: 5
Joined: 04 May 2015 15:38

[SOLVED]DetachCurrentThread not called

Postby valentin J » 04 May 2015 16:12

Hi everyone,

I am developping an App that use libVLC to display MP4 videos. I recompile libVLC two weeks ago in order to get le lastest version.

To manage libVLC, I have created a customView that inherits from SurfaceView. When the customView is attached to the Window (onAttachedToWindow() method), I initialize libVLC with that code :

Code: Select all

private void initVlcPlayer() throws LibVlcException { libVLC = new LibVLC(); libVLC.setHardwareAcceleration(LibVLC.HW_ACCELERATION_DISABLED); libVLC.setSubtitlesEncoding(""); libVLC.setTimeStretching(false); libVLC.setFrameSkip(false); libVLC.setAout(LibVLC.AOUT_OPENSLES); libVLC.setVout(LibVLC.VOUT_ANDROID_SURFACE); libVLC.setChroma("RV32"); libVLC.setDevHardwareDecoder(LibVLC.DEV_HW_DECODER_AUTOMATIC); libVLC.setVerboseMode(true); EventHandler.getInstance().addHandler(videoPlayerHandler); libVLC.init(getContext()); }
When the customView is detached (onDetachedFromWindow() method), I try to deallocate libVLC resources like that. (I don't find any doc on how to use the last LibVLC version so I analysed the VLC for Android app source code, but they never release libVLC. They only stop the video).

Code: Select all

private void release() { if (libVLC != null) { if (libVLC.isPlaying()) { stopVideo(); } EventHandler.getInstance().removeHandler(videoPlayerHandler); videoPlayerHandler.removeCallbacksAndMessages(null); libVLC.detachSurface(); libVLC.destroy(); videoPlayerHandler = null; libVLC = null; videoHeight = 0; videoWidth = 0; Log.i(LOG_TAG, " VLC Player instance released"); } }
The problem is that I regularly have in my log that line :

Code: Select all

W/art﹕ Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[29,tid=1382,Native,Thread*=0xaee7a400,peer=0x135270e0,"libvlcjni"]
It appears everytime a video begins or ends.

I don't think it is a normal behavior, so I post here.

Do you have any ideas?

Maybe I make a bad init/release of libVLC. Dealing with libVLC without real doc is hard...

Thanks in advance for your answers and for all the work you have made and you are still making!

Valentin
Last edited by valentin J on 05 May 2015 12:14, edited 1 time in total.

tguillem
Developer
Developer
Posts: 87
Joined: 04 May 2015 16:38
VLC version: ALL
Operating System: Linux/WIndows/Mac OS

Re: DetachCurrentThread not called

Postby tguillem » 04 May 2015 16:41

Hello,

This warning is normal, we use a pthread_key_create destructor to detach the Java thread, and there is no way to hide this warning.

Thanks for reporting it anyway.

valentin J
New Cone
New Cone
Posts: 5
Joined: 04 May 2015 15:38

Re: DetachCurrentThread not called

Postby valentin J » 04 May 2015 18:24

Ok, thanks for the quick answer!

I guess it is the same thing for this one ?

Code: Select all

linker﹕ libvlcjni.so has text relocations. This is wasting memory and prevents security hardening. Please fix.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: DetachCurrentThread not called

Postby Jean-Baptiste Kempf » 04 May 2015 23:05

This is of no matter :)
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 11 guests