Open croneter opened 3 years ago
Thanks for reporting the issue. I've tried to reproduce this issue in current master and I was not able to do it, or at least I think your issue might be different than the interpretation I can collect from the issue. I tried to play a video file and executed the same json query using this tool: https://forum.kodi.tv/showthread.php?tid=172734 while changing subtitle tracks, disabling subtitles, etc. Here are the results:
Start playback:
http://localhost:8152/jsonrpc?request={"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["subtitleenabled","currentsubtitle"]},"id":38}
{
"currentsubtitle": {
"index": 1,
"isdefault": false,
"isforced": false,
"isimpaired": false,
"language": "",
"name": "(External)"
},
"subtitleenabled": true
}
Disabled subs:
http://localhost:8152/jsonrpc?request={"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["subtitleenabled","currentsubtitle"]},"id":38}
{
"currentsubtitle": {
"index": 1,
"isdefault": false,
"isforced": false,
"isimpaired": false,
"language": "",
"name": "(External)"
},
"subtitleenabled": false
}
Note the above response is correct. The current subtitle in the player is still the older one, but the subtitleenabled in now false
Changed to the first subtitle of the file and reenabled subs:
http://localhost:8152/jsonrpc?request={"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["subtitleenabled","currentsubtitle"]},"id":38}
{
"currentsubtitle": {
"index": 0,
"isdefault": false,
"isforced": false,
"isimpaired": false,
"language": "",
"name": "(External)"
},
"subtitleenabled": true
}
Again, subtitleenabled is now true and the index of the current sub is 0.
Having said that I think you have different expectations on the fired events in your addon and there is nothing wrong with JSON. OnAVChanged
is only fired when some stream changes on the player. It should in fact be fired when you select a different subtitle stream (and this is not happening). It should not be fired when subtitles are disabled though!
I think the bugs at hand in my POV here are:
This issue is now marked stale because it has been open over a year without activity. Remove the stale label or add a comment to reset the stale state.
Not stale
Bug report
Describe the bug
Here is a clear and concise description of what the problem is:
I need to be able to dectect whether Kodi changed its subtitle stream, say from German to English. I would do this using
xbmc.executeJSONRPC
with the JSON MethodPlayer.GetProperties
, so somethine like this:I'm triggering this using
xbmc.Monitor
and the notificationPlayer.OnAVChange
:BUT: neither
currentsubtitle
norsubtitleenabled
ever change even though I switch subtitles for the currently playing video. It DOES work forcurrentaudiostream
, fortunately.Expected Behavior
Here is a clear and concise description of what was expected to happen:
Kodi's JSON-answer for the method
Player.GetProperties
for the propertiescurrentsubtitle
andsubtitleenabled
should change if the user changes the currently playing subtitle.Actual Behavior
currentsubtitle
andsubtitleenabled
NEVER change during a video's playback, no matter what the user does.Possible Fix
Don't know, sorry
To Reproduce
Steps to reproduce the behavior:
Please find a minimal working example Kodi add-on here: https://github.com/croneter/service.player-onavchange-bug-showcase
currentsubtitle
andsubtitleenabled
propertiesDebuglog
The debuglog can be found here: Relevant excerpt where I changed the subtitle language from German to English to Italien:
Screenshots
Here are some links or screenshots to help explain the problem:
Additional context or screenshots (if appropriate)
Here is some additional context or explanation that might help:
Your Environment
Used Operating system:
[ X] Android
[ ] iOS
[ ] tvOS
[ ] Linux
[ ] OSX
[X ] Windows
[ ] Windows UWP
Operating system version/name:
Kodi version: manifested in Kodi 19.x as well as Kodi 18.9
note: Once the issue is made we require you to update it with new information or Kodi versions should that be required. Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.