TheAMM / mpv_thumbnail_script

A Lua script to show preview thumbnails in mpv's OSC seekbar, sans external dependencies
GNU General Public License v3.0
674 stars 67 forks source link

attempt to compare nil with number #57

Open lenormf opened 4 years ago

lenormf commented 4 years ago

Hi,

After playing an .avi video and quitting using Q, the following error was printed:

[mpv_thumbnail_script_client_osc] 
[mpv_thumbnail_script_client_osc] stack traceback:
[mpv_thumbnail_script_client_osc]   .../.config/mpv/scripts/mpv_thumbnail_script_client_osc.lua:1080: in function 'prop'
[mpv_thumbnail_script_client_osc]   mp.defaults:392: in function 'handler'
[mpv_thumbnail_script_client_osc]   mp.defaults:486: in function 'call_event_handlers'
[mpv_thumbnail_script_client_osc]   mp.defaults:520: in function 'dispatch_events'
[mpv_thumbnail_script_client_osc]   mp.defaults:479: in function <mp.defaults:478>
[mpv_thumbnail_script_client_osc]   [C]: in ?
[mpv_thumbnail_script_client_osc]   [C]: in ?
[mpv_thumbnail_script_client_osc] Lua error: .../.config/mpv/scripts/mpv_thumbnail_script_client_osc.lua:1080: attempt to compare nil with number

HTH.

whereistejas commented 4 years ago

I'm facing the same issue. @lenormf refer this please.

KiritoStudio commented 4 years ago

Add the following code before if self.state.available and thumbnailer_options.autogenerate then

        if duration == nil then
            return
        end

should be a workaround.