Incorrect Video Length
Sometimes, probably for AVI files,
LibVLC returns 0 for the
LibVLC#getLength() method. "The native call":(http://git.videolan.org/?p=vlc-ports/android.git;a=blob;f=vlc-android/jni/libvlcjni.c;h=5a8464ad4fd920637648a1f5d13bbc0a5a0cc098;hb=HEAD#l514) seems to be pretty trivial and I don’t see an error. The same videos work fine using the iOS version. The official VLC app shows zero length as well.
#4 Updated by megabitdragon over 7 years ago
I played with the vlc source code and I think I found a "hack" for the 0 length issue. In the avi demux module in the file demux/avi/libavi.c I replaced both occurrences of STREAM_CAN_FASTSEEK with STREAM_CAN_SEEK. According to bug 1532 ( https://trac.videolan.org/vlc/ticket/1532 ), when using FASTSEEK idx1 is not read form the AVI header. These changes forces the use of SEEK just for the header. I only tested on linux version of VLC and the length is correct and the scrolling works as well. Next step ... build android VLClib and testing it in the amahi app :).
#6 Updated by megabitdragon over 7 years ago
You are right. When !FASTSEEK, which is the case for http streams, idx1 is not read. The changes I made enables reading of idx1 for normal seek (the one for the http stream). I am not saying this is the best or even the correct solution but it seems to do the job.
#11 Updated by ming over 7 years ago
That’s why I’m not sure should we include this or not. I see no real difference using the local address, but not sure about the remote one. I already have a not pleasant delay for loading remote videos, so probably you are the judge here. Is it really critical or length is more important than that?
Also available in: Atom