Jump to content

Emby crashing when stopping playback


zomboided

Recommended Posts

zomboided

Hello, I'm writing a Kodi addon which limits the number of videos that'll be played in a playlist.

 

I've a Kodi player class, which does something like this :

 

class KodiPlayer(xbmc.Player):
   
    playback_count = 0

    def __init__ (self):
        xbmc.Player.__init__(self)
        self.logger = None

    def onPlayBackStarted(self, *arg):
        if self.playback_count >= playlist_max_count:
            xbmc.Player().stop()

    def onPlayBackEnded(self, *arg):
        self.playback_count += 1

 

 

The call in onPlayBackStarted to stop playback works, but it has the effect of causing the Emby addon to crash, as below:

 

22:04:59.883 T:13092  NOTICE: EMBY.ga_client -> ERROR:: XBMC is not playing any videofile
                                            Traceback (most recent call last):
                                              File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\ga_client.py", line 24, in wrapper
                                                return func(*args, **kwargs)
                                              File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 76, in onNotification
                                                self._on_play_(data)
                                              File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 98, in _on_play_
                                                item = xbmc.Player().getVideoInfoTag()
                                            RuntimeError: XBMC is not playing any videofile
22:04:59.883 T:13092  NOTICE: EMBY.ga_client -> ERROR:: log_error: onNotification
                                             args: (<kodimonitor.KodiMonitor object at 0x12F1B300>, 'xbmc', 'Player.OnPlay', '{"item":{"id":3862,"type":"episode"},"player":{"playerid":1,"speed":1}}')
                                             kwargs: {}
22:04:59.883 T:13092   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: XBMC is not playing any videofile
                                            Traceback (most recent call last):
                                              File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\ga_client.py", line 24, in wrapper
                                                return func(*args, **kwargs)
                                              File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 76, in onNotification
                                                self._on_play_(data)
                                              File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 98, in _on_play_
                                                item = xbmc.Player().getVideoInfoTag()
                                            RuntimeError: XBMC is not playing any videofile
                                            -->End of Python script error report<--
22:04:59.886 T:13092   ERROR: EXCEPTION: XBMC is not playing any file

 

 

Anything I can do to avoid this?  It happens everytime.  I can post a full log if that helps.

Edited by zomboided
Link to comment
Share on other sites

Angelblue05

I'm sorry, I should have said. Is it possible for you to enable emby for kodi log level set to info? Under add-on settings > advanced > log level info

Link to comment
Share on other sites

zomboided

Nope, still the same problem.  Attached a new log.

 

I can share my addon if that helps.  You just tell it the maximum number of videos to play and then start a playlist.  You can skip to right before the end of each video to make it recreate within 3 videos.

embycrash3.kodi.log

Link to comment
Share on other sites

zomboided

Yep, exceptions are gone!  Thanks for fixing so quickly.

 

I still see this in the log, but if this is just a message and not a crash then no problem

 

11:12:28.772 T:6436  NOTICE: EMBY.kodimonitor -> Method: Player.OnPlay Data: {"item":{"id":3883,"type":"episode"},"player":{"playerid":1,"speed":1}}
11:12:28.775 T:6436  NOTICE: EMBY.kodimonitor -> kodi_id: 3883 item_type: episode
11:12:28.791 T:6436  NOTICE: EMBY.player -> Clear playlist properties.
11:12:28.792 T:6436   ERROR: EXCEPTION: XBMC is not playing any file

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...