I'm using libVLC 3.0.18 build (without some network plugins) for local media playback in my own app.
Mostly, it is doing good, but recenlty I noticed that duration of MPG files doesn't calculated correctly just after media parsing.
I call libvlc_media_parse_with_options(pMedia, libvlc_media_parse_local, -1) on every media in playlist to display their durations inside the playlist before playing them.
For most of file extentions durations are correct, but for MPG files function libvlc_media_get_duration(pMedia) just returns 0 after parsing.
Parsing process finishes without fails (I have checked for libvlc_media_parse_with_options() return code).
There is some logs:
Code: Select all
main input debug: Creating an input for preparsing 'sample.avi'
main meta fetcher debug: looking for meta fetcher module matching "any": 0 candidates
main meta fetcher debug: no meta fetcher modules
main art finder debug: looking for art finder module matching "any": 1 candidates
main art finder debug: no art finder modules matched
PARSED
DURATION: 16000
main input debug: Creating an input for preparsing 'sample.mpg'
main meta fetcher debug: looking for meta fetcher module matching "any": 0 candidates
main meta fetcher debug: no meta fetcher modules
main art finder debug: looking for art finder module matching "any": 1 candidates
main art finder debug: no art finder modules matched
PARSED
DURATION: 0
You can see that duration from AVI file was calculated successfully, but for MPG file it is zero, though debug messages are absolutely identical.
What is even strager is that when I start playing these MPG files they are played just as normal, and when I try to get their duration AFTER starting playback I get the correct duration values.
What could be the reason of wrong MPG media durations after parsing them? And how else can I get correct duration values BEFORE I start media playback?