Skip to content

MainThread is being totally blocked when there is poor or no internet connection and playing new media.

Description

MainThread of application is being blocked when playing new media and there is poor or no internet connection. MainThread will unlock when you for example switch wifi ON and poor mobile data will become OFF. MainThread will block whole phone , you can't do anything even somehow force close app.

here is logs coming from console when MainThread is totally blocked

E/VLC: [0000007c145564b0/206f] libvlc tls client: Error in the pull function. E/VLC: [0000007c145564b0/2071] libvlc tls client: Error in the push function. E/VLC: [0000007c14556750/206b] libvlc tls client: Error in the push function. E/VLC: [0000007c14555a30/206b] libvlc tls client: Error in the push function. E/BufferQueueProducer: [SurfaceTexture-0-7299-0]:1338: disconnect: not connected (req=1) [0000007c14555a30/26aa] libvlc tls client: connection error: Interrupted system call [0000007bf9c5c690/26aa] libvlc stream: HTTP connection failure E/VLC: [0000007c738c6550/26cc] libvlc tls client: connection error: Interrupted system call E/VLC: [0000007c738b7d90/26cc] libvlc stream: HTTP connection failure E/VLC: [0000007c145562f0/26d4] libvlc tls client: connection error: Interrupted system call E/VLC: [0000007c6f1dde90/26d4] libvlc stream: HTTP connection failure E/System: Uncaught exception thrown by finalizer

E/VLC: [0000007c738c4cf0/36f1] libvlc tls client: Error in the push function. E/VLC: [0000007c738c4cf0/36f1] libvlc tls client: The specified session has been invalidated for some reason. E/NdkMediaCodec: sf error code: -38

or in another case :

E/VLC: [0000007bfbba1110/4d2b] libvlc window: request 3 not implemented 2022-05-19 12:38:13.316 19384-19741/com.virtuality.matelkotv E/VLC: [0000007c6f7d1c10/4d1d] libvlc tls client: Error in the push function. E/VLC: [0000007c6f7d1c10/4d1d] libvlc tls client: The specified session has been invalidated for some reason. D/android.media.AudioTrack: [HSM] AudioTrace pause() uid: 11391, pid: 19384 D/android.media.AudioTrack: [HSM] AudioTrace play() uid: 11391, pid: 19384 D/AudioTrack: stop(644): called with 0 frames delivered D/android.media.AudioTrack: [HSM] AudioTrace stop() uid: 11391, pid: 19384 E/NdkMediaCodec: sf error code: -38 W/ACodec: forcing OMX state to Idle when received shutdown in ExecutingState D/SurfaceUtils: disconnecting from surface 0x7bd1845010, reason disconnectFromSurface

Expected behavior

When playing new Media with poor connection,, LibVLC should do everything in async to not block main thread.

Actual behavior

VLC is blocking MainThread totally when switching or playing new Media when having poor or not internet connection.

Steps to reproduce

1.Create array of m3u8 media 2.Try to switch between them on WIFI on and good internet,, (everything is fine) 3.Try to switch to poor mobile data or no internet couple of times ,, (Main thread will get blocked and logical will throw connection error. Result -> Phone or TV totally not usable until connection error resolves. 4.Switch wifi ON,, MainThread will unlock.

Screenshot / video

Context

App version

org.videolan.android:libvlc-all:3.4.9 org.videolan.android:libvlc-all:3.5.0-eap7. (all version of 3.5.0)

earlier versions not tested

Android version

Android 7,8,9,10,11,12

Device model

unspecified,, tested on many devices

App mode

Smartphone TV

Edited by Ralph El