Getting stuck in an extension(Plugin) i'm trying to make

Discuss your Lua playlist, album art and interface scripts.
siddhant0111
New Cone
New Cone
Posts: 3
Joined: 17 Jul 2018 05:15

Getting stuck in an extension(Plugin) i'm trying to make

Postby siddhant0111 » 18 Jul 2018 13:24

What i'm trying to do is making a plugin to load subtitles every 10 seconds, that is even if i change the subtitles in the srt file while streaming the video, then the changed srt will appear as subititles rather than the old one.

I tried using callback before, but it didn't work, but now i'm trying this using a loop such that, i'm calling add_subtitles() followed by sleep(10) inside the loop. What this is doing is loading a particular subtitles file i mention, then after the sleep time is over, the subtitles are loaded again using the add_subtitles function inside the loop.
This is somewhat working, but the problem is as the subtitles are loaded on the video, VLC is throwing a dialogue box after few seconds which reads, Extension "MyPlugin.lua" has stopped working. Click Yes to Kill the process. But in the background subtitles are being displayed just fine.

I don't know how to rectify this. If i click yes, VLC shuts, if i cancel the box, VLC still shuts.

Please help me. I'm onto something, this is just early testing for what i'm trying to build.
A little help wil be appreciated.

Thanks.
Regards,
Siddhant.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Getting stuck in an extension(Plugin) i'm trying to make

Postby mederi » 19 Jul 2018 11:14

It seems that the watchdog in extensions does not work well if it kills VLC and not just an extension. Since there is not a non-busy waiting available in extensions, you should not use busy loops taking a long time (endless) or the watchdog will bite you. You cannot write "dynamic" extensions.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 8 guests