#17988 closed Bugs (Fixed)

Kodi stuck/freeze when closing external player with STOP (keyboard x, json like yatse do...)

Reported by: popy Owned by: FernetMenta
Priority: 4 - Normal
Component: Video playback (inc. audio in video and codecs) Version: 18.0 "Leia" Beta1
Severity: Normal Keywords: PCF playercorefactory
Cc: FernetMenta, Rechi, afedchin Blocked By:
Blocking: Platform: All

Description

When kodi starts an external player and STOP is pressed inside kodi (X on keyboard, stop button in yatse which sends a json stop, ...) kodi stuck/freezes. This was reproduced on two windows 10 x64 clients with latest nightly.

This issue does not happen when the external player is closed by itself (ALT-F4...).

To reproduce:

  • create a playercorefactory.xml with the contents from the quote at the bottom
  • create c:\temp\test.bat with the contents from the quote at the bottom
  • install latest nightly windows x64
  • run kodi and start a movie with 4K in its filename to launch the external player (bat)
  • DONT close the batch file
  • Switch to kodi back with ALT-TAB
  • Press X on the keyboard
  • External Player gets closed
  • Kodi freezes

The last message in the log is (regardless if debug is on or not):

14:14:45.181 T:6040  NOTICE: CExternalPlayer::ExecuteAppW32: WAIT_OBJECT_0
14:14:45.181 T:6040  NOTICE: CExternalPlayer::Process: Stop
14:14:45.315 T:6040  NOTICE: CExternalPlayer::Process: Showing Kodi window

So it seems the issue happens right after those outputs in ExternalPlayer.cpp in function Proccess. Maybe @ line:

CServiceBroker::GetWinSystem().Show();

playercorefactory.xml which launches c:\temp\test.bat:

<playercorefactory>
    <players>
        <player name="MPC-HC" type="ExternalPlayer" audio="false" video="true">
            <filename>C:\temp\test.bat</filename>
            <args>"{1}"</args>
            <hidexbmc>false</hidexbmc>
            <hideconsole>false</hideconsole>
            <warpcursor>none</warpcursor>
            <playcountminimumtime>1140</playcountminimumtime>
        </player>
    </players>
    <rules action="prepend">
        <rule filename=".*4K.*" player="MPC-HC"/>        
    </rules>
</playercorefactory>

contents of test.bat:

@echo off
echo Playing "%1"
pause

Change History (4)

comment:1 Changed at 2018-08-16T06:48:49+01:00 by FernetMenta

  • Cc afedchin added

comment:2 Changed at 2018-08-16T18:10:36+01:00 by popy

I have debugged it to he call of:

SetWindowPos(m_hWnd, windowAfter, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);

in function CWinSystemWin32::Show(). This wikndows API is the last function which gets called until kodi freezes! Have checked the m_hWnd, its correct and the same hwnd as spyxx.exe is showing. windowAfter is 0, and this is the value for HWND_TOP, which is ok.

Any hints?

comment:4 Changed at 2018-08-20T06:41:03+01:00 by FernetMenta

  • Milestone changed from Pending / Future to 18.0 "Leia"
  • Resolution set to Fixed
  • Status changed from new to closed

fixed by linked PR

Note: See TracTickets for help on using tickets.