ManBehindMooN / kodi_plugin_video_srgssr_ch_replay

5 stars 3 forks source link

Player crashes when seeking #9

Closed joachimBurket closed 2 years ago

joachimBurket commented 2 years ago

Hi,

I experience player crash for some time when trying to seek in the RTS shows I tried with some SRF shows and it doesn't seems appears on it.

Here is a debug log of the player crash:

2022-04-09 09:37:42.619 T:25      DEBUG <general>: Keyboard: scancode: 0x72, sym: 0x275, unicode: 0x0000, modifier: 0x0
2022-04-09 09:37:42.619 T:25      DEBUG <general>: HandleKey: right (0xf083) pressed, action is StepForward
2022-04-09 09:37:42.619 T:25      DEBUG <general>: ------ Window Init (DialogSeekBar.xml) ------
2022-04-09 09:37:42.619 T:25      DEBUG <general>: ------ Window Deinit (Pointer.xml) ------
2022-04-09 09:37:42.619 T:25      DEBUG <general>: ------ Window Init (Custom_1109_TopBarOverlay.xml) ------
2022-04-09 09:37:42.620 T:25      DEBUG <general>: started alarm with name: seekbartimer
2022-04-09 09:37:42.737 T:25      DEBUG <general>: Keyboard: scancode: 0x72, sym: 0x275, unicode: 0x0000, modifier: 0x0
2022-04-09 09:37:42.823 T:25      DEBUG <general>: Skipped 1 duplicate messages..
2022-04-09 09:37:42.823 T:25      DEBUG <general>: HandleKey: right (0xf083) pressed, action is StepForward
2022-04-09 09:37:42.859 T:25      DEBUG <general>: Keyboard: scancode: 0x72, sym: 0x275, unicode: 0x0000, modifier: 0x0
2022-04-09 09:37:42.950 T:25      DEBUG <general>: Skipped 1 duplicate messages..
2022-04-09 09:37:42.950 T:25      DEBUG <general>: HandleKey: right (0xf083) pressed, action is StepForward
2022-04-09 09:37:43.011 T:25      DEBUG <general>: Keyboard: scancode: 0x72, sym: 0x275, unicode: 0x0000, modifier: 0x0
2022-04-09 09:37:43.084 T:25      DEBUG <general>: Skipped 1 duplicate messages..
2022-04-09 09:37:43.084 T:25      DEBUG <general>: HandleKey: right (0xf083) pressed, action is StepForward
2022-04-09 09:37:43.152 T:25      DEBUG <general>: Keyboard: scancode: 0x72, sym: 0x275, unicode: 0x0000, modifier: 0x0
2022-04-09 09:37:43.859 T:363     DEBUG <general>: CVideoPlayer::SetCaching - caching state 2
2022-04-09 09:37:43.859 T:363     DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2022-04-09 09:37:43.859 T:363     DEBUG <general>: demuxer seek to: 281807.018458
2022-04-09 09:37:43.880 T:363     DEBUG <general>: SeekTime - unknown position after seek
2022-04-09 09:37:43.880 T:363     DEBUG <general>: demuxer seek to: 281807.018458, success
2022-04-09 09:37:43.880 T:363     DEBUG <general>: CVideoPlayer::FlushBuffers - flushing buffers
2022-04-09 09:37:43.891 T:365   WARNING <general>: OutputPicture - timeout waiting for buffer
2022-04-09 09:37:43.921 T:25      DEBUG <general>: ------ Window Init (VideoOSD.xml) ------
2022-04-09 09:37:43.921 T:25      DEBUG <general>: ------ Window Init (Pointer.xml) ------
2022-04-09 09:37:43.952 T:366     DEBUG <general>: CDVDAudio::Pause - pausing audio stream
2022-04-09 09:37:44.052 T:366     DEBUG <general>: CDVDAudio::Flush - flush audio stream
2022-04-09 09:37:44.052 T:366     DEBUG <general>: CDVDAudio::Pause - pausing audio stream
2022-04-09 09:37:44.052 T:366     DEBUG <general>: CVideoPlayerAudio - CDVDMsg::GENERAL_SYNCHRONIZE
2022-04-09 09:37:44.052 T:365     DEBUG <general>: CVideoPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE
2022-04-09 09:37:44.052 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [hls] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-39-f1-a1.m4s' for reading
2022-04-09 09:37:44.120 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [hls] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-40-f1-a1.m4s' for reading
2022-04-09 09:37:44.185 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [https] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-41-f1-a1.m4s' for reading
2022-04-09 09:37:44.232 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [https] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-42-f1-a1.m4s' for reading
2022-04-09 09:37:44.243 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [https] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-43-f1-a1.m4s' for reading
2022-04-09 09:37:44.266 T:363     ERROR <general>: ffmpeg[0x55a7732ade80X]: [mov,mp4,m4a,3gp,3g2,mj2] stream 0, offset 0x1ba169: partial file
2022-04-09 09:37:44.266 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [hls] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-39-f5-v1.m4s' for reading
2022-04-09 09:37:44.366 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [hls] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-40-f5-v1.m4s' for reading
2022-04-09 09:37:45.659 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [https] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-41-f5-v1.m4s' for reading
2022-04-09 09:37:49.251 T:25      DEBUG <general>: ------ Window Deinit (Pointer.xml) ------
2022-04-09 09:37:51.334 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [https] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-42-f5-v1.m4s' for reading
2022-04-09 09:37:52.580 T:25      DEBUG <general>: ------ Window Deinit (VideoOSD.xml) ------
2022-04-09 09:37:52.603 T:25      DEBUG <general>: ------ Window Deinit (DialogSeekBar.xml) ------
2022-04-09 09:37:52.603 T:25      DEBUG <general>: ------ Window Deinit (Custom_1109_TopBarOverlay.xml) ------
2022-04-09 09:37:54.164 T:25      DEBUG <general>: ------ Window Init (VideoOSD.xml) ------
2022-04-09 09:37:54.165 T:25      DEBUG <general>: ------ Window Init (DialogSeekBar.xml) ------
2022-04-09 09:37:54.165 T:25      DEBUG <general>: ------ Window Init (Pointer.xml) ------
2022-04-09 09:37:54.165 T:25      DEBUG <general>: ------ Window Init (Custom_1109_TopBarOverlay.xml) ------
2022-04-09 09:37:54.166 T:25      DEBUG <general>: started alarm with name: seekbartimer
2022-04-09 09:38:00.929 T:25      DEBUG <general>: ------ Window Deinit (Pointer.xml) ------
2022-04-09 09:38:04.102 T:363     ERROR <general>: ffmpeg[0x55a7732ade80X]: [tls] Error decoding the received TLS packet.
2022-04-09 09:38:04.102 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [https] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-43-f5-v1.m4s' for reading
2022-04-09 09:38:04.105 T:363     ERROR <general>: ffmpeg[0x55a7732ade80X]: [mov,mp4,m4a,3gp,3g2,mj2] stream 0, offset 0x4f533bd: partial file
2022-04-09 09:38:04.105 T:363      INFO <general>: ffmpeg[0x55a7732ade80X]: [hls] Opening 'https://rts-vod-amd.akamaized.net/ww/12470228/93cfe1de-56ff-3e85-b7ac-0e078432aa88/seg-43-f5-v1.m4s' for reading
2022-04-09 09:38:04.136 T:363     DEBUG <general>: CVideoPlayer::SetCaching - caching state 0
2022-04-09 09:38:04.136 T:363     DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2022-04-09 09:38:04.136 T:363      INFO <general>: Process - eof reading from demuxer
2022-04-09 09:38:04.136 T:363      INFO <general>: CVideoPlayer::OnExit()
2022-04-09 09:38:04.136 T:363      INFO <general>: VideoPlayer: eof, waiting for queues to empty
2022-04-09 09:38:04.136 T:363      INFO <general>: Closing stream player 1
2022-04-09 09:38:04.136 T:363      INFO <general>: Waiting for audio thread to exit
2022-04-09 09:38:04.145 T:366      INFO <general>: thread end: CVideoPlayerAudio::OnExit()
2022-04-09 09:38:04.145 T:366     DEBUG <general>: Thread VideoPlayerAudio 140370795341568 terminating
2022-04-09 09:38:04.146 T:363      INFO <general>: Closing audio device
2022-04-09 09:38:04.146 T:363     DEBUG <general>: CDVDAudio::Flush - flush audio stream
2022-04-09 09:38:04.146 T:31      DEBUG <general>: CActiveAE::DiscardStream - audio stream deleted
2022-04-09 09:38:04.146 T:31      DEBUG <general>: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2022-04-09 09:38:04.146 T:363      INFO <general>: Skipped 2 duplicate messages..
2022-04-09 09:38:04.146 T:363      INFO <general>: Deleting audio codec
2022-04-09 09:38:04.146 T:363      INFO <general>: Closing stream player 2
2022-04-09 09:38:04.146 T:363      INFO <general>: waiting for video thread to exit
2022-04-09 09:38:04.146 T:365     ERROR <general>: Got MSGQ_ABORT or MSGO_IS_ERROR return true
2022-04-09 09:38:04.146 T:365      INFO <general>: thread end: video_thread
2022-04-09 09:38:04.146 T:365     DEBUG <general>: Thread VideoPlayerVideo 140370552014592 terminating
2022-04-09 09:38:04.146 T:363      INFO <general>: deleting video codec
2022-04-09 09:38:04.157 T:375     DEBUG <general>: Thread JobWorker start, auto delete: true
2022-04-09 09:38:04.166 T:363     DEBUG <general>: Thread VideoPlayer 140370868877056 terminating
2022-04-09 09:38:04.169 T:375      INFO <general>: Deleting settings information for files plugin://plugin.video.srgssr_ch_replay/?url=12470219&urn=urn:rts:video:12470228&mode=playEpisode&channel=rts
2022-04-09 09:38:04.169 T:376     DEBUG <general>: Thread JobWorker start, auto delete: true
2022-04-09 09:38:04.169 T:376     DEBUG <general>: DoWork - Saving file state for video item plugin://plugin.video.srgssr_ch_replay/?url=12470219&urn=urn:rts:video:12470228&mode=playEpisode&channel=rts
2022-04-09 09:38:04.190 T:376     DEBUG <general>: OnPlayBackEnded: CApplication::OnPlayBackEnded
2022-04-09 09:38:04.196 T:25      DEBUG <general>: Clearing cached fileitems [plugin://plugin.video.srgssr_ch_replay/]
2022-04-09 09:38:04.197 T:25       INFO <general>: CVideoPlayer::CloseFile()
2022-04-09 09:38:04.197 T:25      DEBUG <general>: DeleteRenderer - deleting renderer
2022-04-09 09:38:04.197 T:25      DEBUG <general>: LinuxRendererGL: Cleaning up GL resources
2022-04-09 09:38:04.200 T:25       INFO <general>: VideoPlayer: waiting for threads to exit
2022-04-09 09:38:04.200 T:25       INFO <general>: VideoPlayer: finished waiting
2022-04-09 09:38:04.200 T:25       INFO <general>: CVideoPlayer::CloseFile()
2022-04-09 09:38:04.200 T:25       INFO <general>: VideoPlayer: waiting for threads to exit
2022-04-09 09:38:04.200 T:25       INFO <general>: VideoPlayer: finished waiting
2022-04-09 09:38:04.201 T:25      DEBUG <general>: Radio UECP (RDS) Processor - delete ~CDVDRadioRDSData
2022-04-09 09:38:04.201 T:25      DEBUG <general>: CGUIWindowManager::PreviousWindow: Deactivate
2022-04-09 09:38:04.201 T:25      DEBUG <general>: ------ Window Deinit (VideoOSD.xml) ------
2022-04-09 09:38:04.201 T:25      DEBUG <general>: ------ Window Deinit (VideoFullScreen.xml) ------
2022-04-09 09:38:04.203 T:25      DEBUG <general>: CGUIWindowManager::PreviousWindow: Activate new
2022-04-09 09:38:04.203 T:25      DEBUG <general>: ------ Window Init (MyVideoNav.xml) ------
2022-04-09 09:38:04.204 T:25      ERROR <general>: Control 55 in window 10025 has been asked to focus, but it can't
2022-04-09 09:38:04.205 T:25      DEBUG <general>: CGUIMediaWindow::GetDirectory (plugin://plugin.video.srgssr_ch_replay/?channel=rts&mode=listEpisodes&numberOfEpisodes&showbackground=https%3a%2f%2fwww.rts.ch%2f2020%2f08%2f12%2f14%2f49%2f11436001.image%2f16x9&url=11431182&urn=urn%3arts%3ashow%3atv%3a11431182)
2022-04-09 09:38:04.205 T:25      DEBUG <general>:   ParentPath = [plugin://plugin.video.srgssr_ch_replay/?channel=rts&mode=listEpisodes&numberOfEpisodes&showbackground=https%3a%2f%2fwww.rts.ch%2f2020%2f08%2f12%2f14%2f49%2f11436001.image%2f16x9&url=11431182&urn=urn%3arts%3ashow%3atv%3a11431182]
2022-04-09 09:38:04.205 T:377     DEBUG <general>: Thread waiting start, auto delete: false
2022-04-09 09:38:04.205 T:375     DEBUG <general>: CAddonDatabase::SetLastUsed[plugin.video.srgssr_ch_replay] took 1 ms
2022-04-09 09:38:04.205 T:377     DEBUG <general>: StartScript - calling plugin Unofficial SRG SSR Replay('plugin://plugin.video.srgssr_ch_replay/','35','?channel=rts&mode=listEpisodes&numberOfEpisodes&showbackground=https%3a%2f%2fwww.rts.ch%2f2020%2f08%2f12%2f14%2f49%2f11436001.image%2f16x9&url=11431182&urn=urn%3arts%3ashow%3atv%3a11431182','resume:false')
2022-04-09 09:38:04.205 T:378     DEBUG <general>: Thread LanguageInvoker start, auto delete: false
2022-04-09 09:38:04.205 T:378      INFO <general>: initializing python engine.
2022-04-09 09:38:04.206 T:378     DEBUG <general>: CPythonInvoker(35, /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py): start processing
2022-04-09 09:38:04.244 T:378     DEBUG <general>: -->Python Interpreter Initialized<--
2022-04-09 09:38:04.244 T:378     DEBUG <general>: 

2022-04-09 09:38:04.244 T:378     DEBUG <general>: CPythonInvoker(35, /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py): the source file to load is "/home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py"
2022-04-09 09:38:04.244 T:378     DEBUG <general>: CPythonInvoker(35, /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py): setting the Python path to /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay:/home/kodi/.kodi/addons/script.module.certifi/lib:/home/kodi/.kodi/addons/script.module.chardet/lib:/home/kodi/.kodi/addons/script.module.idna/lib:/home/kodi/.kodi/addons/script.module.requests/lib:/home/kodi/.kodi/addons/script.module.urllib3/lib:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/dist-packages:/usr/lib/python3/dist-packages
2022-04-09 09:38:04.244 T:378     DEBUG <general>: CPythonInvoker(35, /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py): entering source directory /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay
2022-04-09 09:38:04.244 T:378     DEBUG <general>: CPythonInvoker(35, /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py): instantiating addon using automatically obtained id of "plugin.video.srgssr_ch_replay" dependent on version 3.0.0 of the xbmc.python api
2022-04-09 09:38:04.305 T:25      DEBUG <general>: ------ Window Init (DialogBusy.xml) ------
2022-04-09 09:38:04.306 T:25      DEBUG <general>: Uninhibiting OS screen saver
2022-04-09 09:38:04.306 T:373     DEBUG <general>: Thread Timer 140370579015424 terminating
2022-04-09 09:38:04.307 T:25      DEBUG <general>: ffmpeg[(nil)X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-04-09 09:38:04.347 T:25      DEBUG <general>: Skipped 1 duplicate messages..
2022-04-09 09:38:04.347 T:25      DEBUG <general>: ------ Window Deinit (DialogSeekBar.xml) ------
2022-04-09 09:38:04.390 T:25      DEBUG <general>: ------ Window Deinit (Custom_1109_TopBarOverlay.xml) ------
2022-04-09 09:38:04.451 T:32       INFO <general>: CActiveAESink::OpenSink - initialize sink
2022-04-09 09:38:05.003 T:28      DEBUG <general>: Sink changed
2022-04-09 09:38:05.003 T:32      DEBUG <general>: CActiveAESink::OpenSink - trying to open device PULSE:Default
2022-04-09 09:38:05.009 T:32      DEBUG <general>: PulseAudio: Context authorizing
2022-04-09 09:38:05.016 T:32      DEBUG <general>: PulseAudio: Context setting name
2022-04-09 09:38:05.016 T:32      DEBUG <general>: PulseAudio: Context ready
2022-04-09 09:38:05.017 T:28      DEBUG <general>: Sink changed
2022-04-09 09:38:05.017 T:32      DEBUG <general>: PulseAudio: Stream ready
2022-04-09 09:38:05.017 T:32       INFO <general>: PulseAudio: Opened device Default in pcm mode with Buffersize 300 ms Periodsize 100 ms
2022-04-09 09:38:05.017 T:28      DEBUG <general>: Sink changed
2022-04-09 09:38:05.017 T:32      DEBUG <general>: CActiveAESink::OpenSink - PULSE Initialized:
2022-04-09 09:38:05.017 T:32      DEBUG <general>:   Output Device : Default
2022-04-09 09:38:05.017 T:32      DEBUG <general>:   Sample Rate   : 44100
2022-04-09 09:38:05.017 T:32      DEBUG <general>:   Sample Format : AE_FMT_FLOAT
2022-04-09 09:38:05.017 T:32      DEBUG <general>:   Channel Count : 2
2022-04-09 09:38:05.017 T:32      DEBUG <general>:   Channel Layout: FL, FR
2022-04-09 09:38:05.017 T:32      DEBUG <general>:   Frames        : 4410
2022-04-09 09:38:05.017 T:32      DEBUG <general>:   Frame Size    : 8
2022-04-09 09:38:05.018 T:31      DEBUG <general>: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2022-04-09 09:38:05.018 T:28      DEBUG <general>: Skipped 1 duplicate messages..
2022-04-09 09:38:05.018 T:28      DEBUG <general>: Sink changed
2022-04-09 09:38:05.100 T:378     DEBUG <CAddonSettings[plugin.video.srgssr_ch_replay]>: trying to load setting definitions from old format...
2022-04-09 09:38:05.100 T:378     DEBUG <CSettingsManager>: requested setting (srgssrToken) was not found.
2022-04-09 09:38:05.100 T:378     DEBUG <CSettingsManager>: requested setting (srgssrTokenTS) was not found.
2022-04-09 09:38:05.101 T:378     DEBUG <general>: request: GET https://api.srgssr.ch/videometadata/v2/latest_episodes/shows/11431182
2022-04-09 09:38:05.255 T:378      INFO <general>: CPythonInvoker(35, /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py): script successfully run
2022-04-09 09:38:05.255 T:378     DEBUG <general>: onExecutionDone(35, /home/kodi/.kodi/addons/plugin.video.srgssr_ch_replay/addon.py)
2022-04-09 09:38:05.255 T:377     DEBUG <general>: Thread waiting 140370868877056 terminating
2022-04-09 09:38:05.271 T:378     DEBUG <general>: .
2022-04-09 09:38:05.297 T:25      DEBUG <general>: ------ Window Deinit (DialogBusy.xml) ------
2022-04-09 09:38:05.297 T:25      DEBUG <general>: Saving fileitems [plugin://plugin.video.srgssr_ch_replay/?channel=rts&mode=listEpisodes&numberOfEpisodes&showbackground=https%3a%2f%2fwww.rts.ch%2f2020%2f08%2f12%2f14%2f49%2f11436001.image%2f16x9&url=11431182&urn=urn%3arts%3ashow%3atv%3a11431182]
2022-04-09 09:38:05.297 T:25      DEBUG <general>:   -- items: 11, sort method: 0, ascending: false
2022-04-09 09:38:05.299 T:380     DEBUG <general>: Thread BackgroundLoader start, auto delete: false
2022-04-09 09:38:05.303 T:376     DEBUG <general>: ffmpeg[0x7faa54107990X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-04-09 09:38:05.305 T:380     DEBUG <general>: Thread BackgroundLoader 140368817624832 terminating
2022-04-09 09:38:05.312 T:375     DEBUG <general>: ffmpeg[0x7faa4eb796a0X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-04-09 09:38:05.330 T:32      ERROR <general>: Sink Timer expired for more than buffer time: 300l
2022-04-09 09:38:05.331 T:378      INFO <general>: Python interpreter stopped
2022-04-09 09:38:05.331 T:378     DEBUG <general>: Thread LanguageInvoker 140369245230848 terminating

Has anyone experienced a similar issue ?

joachimBurket commented 2 years ago

I tried reading the shows using the Inputstream Adaptive player, and the crash don't appear with it:

def play_episode(urn, channel, showid):
    """
    this method plays the selected episode
    """

    besturl = _parse_integrationplayer_2(urn)

    # add authentication token for akamaihd
    if "akamaihd" in urlparse(besturl).netloc:
        url = "http://tp.srgssr.ch/akahd/token?acl=" + urlparse(besturl).path
        response = json.load(_open_url(url))
        token = response["token"]["authparams"]
        besturl = besturl + '?' + token

    listitem = xbmcgui.ListItem(path=besturl)
    listitem.setContentLookup(False)
    listitem.setMimeType("application/vnd.apple.mpegurl")
    listitem.setProperty("inputstream", "inputstream.adaptive")
    listitem.setProperty("inputstream.adaptive.manifest_type", "hls")
    listitem.setProperty("isPlayable", "true")
    _addSubtitles(listitem, channel, showid)

    xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)

I don't know if using the InputStream Adaptive can be considered?

ManBehindMooN commented 2 years ago

hi @joachimBurket, Thanks for the feedback and I will further investigate. I quickly tried 20+ different streams from RTS on my Win10 & Android setup with Kodi 19.4 and I have not experienced any issues.

ManBehindMooN commented 2 years ago

The adaptive Inputstream might be a working solution: https://github.com/xbmc/inputstream.adaptive/wiki/Integration.

As I can see we have all the information: https://il.srgssr.ch/integrationlayer/2.0/mediaComposition/byUrn/urn:rts:video:12998907.json image

listitem = xbmcgui.ListItem(path=besturl)
listitem.setContentLookup(False)
listitem.setMimeType("application/x-mpegURL")
listitem.setProperty("inputstream", "inputstream.adaptive")
listitem.setProperty("inputstream.adaptive.manifest_type", "hls")
listitem.setProperty("isPlayable", "true")
_addSubtitles(listitem, channel, showid)
joachimBurket commented 2 years ago

Wow, I didn't expect an answer so soon, thanks!

What is the Kodi version and on which operating system is Kodi currently running?

I tried in two places:

Could you provide me with the RTS TV show names you experienced this behavior?

The error occurs on every shows (I just re-tried with "52 minutes" or the "19h30").

joachimBurket commented 2 years ago

As for the inputstream adaptive, there is a helper (https://github.com/emilsvennesson/script.module.inputstreamhelper) that is useful to check if it is available on the OS and which kodi version is running. I made a pull request #10 using it.

ManBehindMooN commented 2 years ago

Funny, every add-on error that has been reported so far was on a Linux os πŸ’― (sometimes I wonder if most of our users just use Linux :) πŸ‘

Anyway thanks for the PR I'm gonna test it and create a release branch as we do not allow code changes on the master before it is released in the official Kodi repository.

joachimBurket commented 2 years ago

Hahah Linux for life :heart_eyes: :stuck_out_tongue_winking_eye:

But with C++ and Python, I'm already amazed that kodi works on multiple platforms without dying too often :sweat_smile:

Again thanks for your work! :)

ManBehindMooN commented 2 years ago

@joachimBurket have a look at https://github.com/ManBehindMooN/kodi_plugin_video_srgssr_ch_replay/blob/feature/3.0.4/plugin.video.srgssr_ch_replay/addon.py

I changed the code a bit in order to make it more generic and our add-on cannot be played lower than Kodi 19 (matrix) therefore I removed those checks.

ManBehindMooN commented 2 years ago

In general the Inputstream Adaptive seems to work but I'm quite unhappy that the initial 1080p or 720p stream is massively scaled down to 960x540.

ManBehindMooN commented 2 years ago

The Inputstream Adaptive configuration can be enabled. I guess it is a good compromise for those users who don't need it.

joachimBurket commented 2 years ago

Hm strange, I haven't a very good understanding of the inputstream adaptive for now.

A setting could be added in this addon to activate it (default to false), and checked in the _set_inputstream_params() method

ManBehindMooN commented 2 years ago

@joachimBurket I added such a setting on the branch. Have a look at it if it works for you. I don't understand why all the full HD streams are at a maximum of 960x540. Maybe it is scaling up after a while. The streams I tested I got the feeling that the quality is worse with the adaptive inputstream. Just test it for a while if you are happy then I will release a new version. Let me know.

joachimBurket commented 2 years ago

SGTM.

I'll try to check the quality I'm getting in the next weeks.

ManBehindMooN commented 2 years ago

@joachimBurket I found a workaround for the low resolution. I changed the InputStream Adaptive default settings: image Now I can manually select the resolutions. The thing that surprised me the most was when I switched it back to the default settings (automatic stream selection) then the full HD stream was selected. Do you have a similar behavior?

joachimBurket commented 2 years ago

Well done! I tested it and also had this behavior, but couldn't find any logic behind it.

ManBehindMooN commented 2 years ago

This issue is going to be solved with the upcoming version 3.0.4 (https://github.com/ManBehindMooN/kodi_plugin_video_srgssr_ch_replay/tree/feature/3.0.4).

@meierfra & @joachimBurket:

Latest in two weeks I'm going to create a pull request for the official Kodi repository πŸ˜ƒ

ManBehindMooN commented 2 years ago

@joachimBurket Have a look at: https://github.com/ManBehindMooN/kodi_plugin_video_srgssr_ch_replay/commit/f806db8d675d96ffc9b77ca5428c2741c5dbb1c2 (there was a missing part in the french translation... any feedback)?

https://github.com/ManBehindMooN/kodi_plugin_video_srgssr_ch_replay/commit/55978cdf514ea2ffea9e26389bcf8be05f781efc => you have been specially mentioned in the new version ❀️‍πŸ”₯

joachimBurket commented 2 years ago

Oups forgot this one πŸ˜… I added some comments on the commits ;)

joachimBurket commented 2 years ago

Also thanks for the mention πŸŽ‰

ManBehindMooN commented 2 years ago

Oups forgot this one πŸ˜… I added some comments on the commits ;)

no worries πŸ˜„

ManBehindMooN commented 2 years ago

Also thanks for the mention πŸŽ‰

Welcome!!!