xbmc / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS, tvOS and Windows.

Home Page:https://kodi.tv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starting file playback with keyboard Enter button is broken in master

smp79 opened this issue · comments

commented

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

Starting playback in file mode with Enter button seems broken.

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Keyboard Enter button should start the playback of any video file in the folder.

To Reproduce

Steps to reproduce the behavior:

  1. Go to a folder with multiple video files
  2. Select any file and press Enter
  3. Playback would start but it would start from the first file in the folder, regardless of which file is actually selected.

Debuglog

The debuglog can be found here:
debug log

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:

  • Android

  • iOS

  • tvOS

  • Linux

  • macOS

  • Windows

  • Windows UWP

  • Operating system version/name: LibreELEC

  • Kodi version: current master

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.

Hmm, can't reproduce, starts the selected file when browsing via the file manager in the settings or opening a video source as a folder.

commented

I just re-tested with videos on a USB drive. Videos->Files->.... Same issue. Will try to figure out which commit broke it.

commented

It's #24720. No issue after building without that PR.

It's #24720. No issue after building without that PR.

@78andyp can you please have a look and fix the regression? Would be a good chance to address the other things we would like you to change in the code you changed for that PR.

Many apologies and thanks for reporting. Looking now.

Hi @smp79

I've not managed to reproduce yet.

Can I ask:

  • looking at the log it looks like you are trying to play smb://192.168.1.2/MEDIA/1/hdr/(HDR HEVC 10-bit BT.2020 59.940fps) Camp by Sony.mp4 - is that really the file you are trying to play or the first file in the folder that plays instead??
  • does it work if you select the file by clicking (or something other than pressing enter)?? (I'm confused if this is the case as I haven't knowingly changed anything that would cause this)
  • Are you trying to use 'Play from Here' by any chance - as I did alter that code??

Otherwise - to try and reproduce i've done the following:

  • Fresh build of master (I know I am win64 and you are libreelec)
  • New local database
  • SMB directory with 4 mp4 files - all different names/movies - navigate there with keyboard (Videos -> Files -> select source -> select directory -> highlight file with arrow keys and press enter
  • (NB sources predefined in sources.xml)
  • Works for all files
  • Also copied the files to USB stick and did the same
  • Works for all files.
commented

...Camp by Sony.mp4 is the first file in the folder, I tried to play another file.
It works fine if I select the file, press C, then select Play in the context menu.
I don't use "Play from here"

Thank you. Could you share the name of the file you were trying to play - and i'll try and reproduce directory exactly.

commented

No issue with Windows nightly. Maybe something Linux-specific?

Possibly.

There might be a problem in CGUIMediaWindow::OnPlayAndQueueMedia

Are you able to generate a test build with #25099 added?? It's just some logging a) to see if it gets triggered and b) to see if then identifies the issue.

I can reproduce if I select play from here in a folder with multiple items - it always plays the first - because it seems that p->GetVideoInfoTag()->m_basePath is actually empty.

Is it possible that pressing eneter in Linux triggers something different to pressing enter in Windows??

Thanks

No issue with Windows nightly. Maybe something Linux-specific?

I tested on Linux and don't see the issue, so the difference is probably somewhere else?

Thanks @smp79.
That debug log the problem in OnPlayAndQueueMedia.
Not sure why that get called in your situation as here it's only called on play from here.
Will fix and update #25099.

Hi @smp79. Could you try now with the updated #25099. Thanks.

commented

The updated #25099 fixed it! 👍

The updated #25099 fixed it! 👍

Brilliant. Thanks for letting us know.
I still have no idea (as I am really not familiar with Linux) as to why pressing enter seems to invoke a different pathway to clicking play.
Out of interest - when you select a video by pressing enter does it automatically play the subsequent videos??

commented

Out of interest - when you select a video by pressing enter does it automatically play the subsequent videos??

Yes, the subsequent videos are played automatically, as long as "Play next video automatically" is enabled

This can be controlled via a setting.

Out of interest - when you select a video by pressing enter does it automatically play the subsequent videos??

Yes, the subsequent videos are played automatically, as long as "Play next video automatically" is enabled

Thanks. I missed that.
So if you select play from the context menu should that mean they play automatically as well?? (As it worked correctly with the buggy code it would suggest that they won't play automatically)

commented

Yes, the subsequent videos are played automatically

Ah, you mean without the fix? I just tried to play it without the fix, it actually doesn't automatically play the next video. Playback just stops.

Both with and without the fix

commented

With the fix the next video plays automatically, as it should

commented

Starting playback via context menu works correctly with and without the fix, the next video plays automatically in both cases

Brilliant.
Although that leads to another question (in my mind - and I'm new to this so the answer may be obvious).
If automatic is enabled then don't Play and Play from here on the context menu do exactly the same thing??
Should one be removed?? Should play only play the single item irrespective of toggle??

ie.
Enter = play or play from here depending on automatic toggle
Context Play = play single always
Context Play from here = play item and remaining automatically always

commented

If automatic is enabled "Play from here" is replaced with "Play only this"

Exactly, depending on the setting value "Play" does different things. If it is enabled, "Play" is actually a 'play from here'. If it is disabled, "Play" performs a 'play only this'.
Dependent on the setting value there is always one more item, either "Play only this" or "Play from here", doing the opposite of "Play".

Thanks for the clarification.

commented

I just noticed that the issue is triggered only when "Play next video automatically" is enabled. I can reproduce it on Windows too

Or if you select play from here.
The code in CGUIMediaWindow::OnPlayAndQueueMedia is what generates the playlist.