Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next playlist item doesn't start from beginning #618

Open
mbalandis opened this issue Jun 29, 2023 · 28 comments
Open

Next playlist item doesn't start from beginning #618

mbalandis opened this issue Jun 29, 2023 · 28 comments
Labels
bug / problem help wanted Anyone willing to help can fix/implement this

Comments

@mbalandis
Copy link

Describe the bug

When double clicking on the playlist item it plays from the position of where current item is currently playing. In other words, it doesn't start from beginning.

To Reproduce
Steps to reproduce the behaviour:

  1. Join a room
  2. Drag some videos in the playlist (in my case I used MKVs but I don't think it matters)
  3. Play one video and skip somewhere middle
  4. Double click on the next video

Expected behaviour
Next video starts from 0:00

Version and platform:

  • OS: [e.g. Windows 10 64-bit]
  • Syncplay 1.7.0
  • MPC-HC (64-bit) 2.0.0
@Et0h
Copy link
Contributor

Et0h commented Jul 3, 2023

Thanks for reporting this problem. Can you confirm whether or not you get this issue when using mpv/mpv.net?

@mbalandis
Copy link
Author

Hi. Thanks for reply.

I will test it at some point this week and let you know.

@mbalandis
Copy link
Author

@Et0h I can confirm that in mpv.net it has no problem for the issue I have reported. VLC which has red txt showing that tracks time incorrectly also doesn't have this issue. I have also tried MPC-BE and it doesn't have this problem.

It seems to be a problem only with MPC-HC. In my case: MPC-HC (64-bit) 2.0.0

@Et0h
Copy link
Contributor

Et0h commented Jul 24, 2023

Syncplay's support for MPC-HC was added before the playlist feature exists, and Syncplay's support was for the original MPC-HC which was discontinued in 2017 rather than MPC-HC v2 which is being mainained by clsid2. Syncplay relies on volunteers, and at present nobody is currently volunteering to maintain Syncplay's support for MPC-HC.

As such, you can either try to fix it yourself or move over to mpv/mpv.net which is being actively supported by Syncplay's core developers and is the player with the best Syncplaycompatability.

@Et0h
Copy link
Contributor

Et0h commented Aug 4, 2023

Okay, I had some free time so I tried to fix this issue. I wasn't able to reproduce it but I assume it happens when it takes so long to open a file that the setPosition is cancelled because no file is playing when it tries to reset the position and my computer is just too quick at loading files to see the issue.

@mbalandis Please test the changes at: https://github.com/Syncplay/syncplay/actions/runs/5766082434 (use the Syncplay-1.7.0-Setup.exe or Syncplay_1.7.0_Portable artefacts to get the new build).

Let me know if this change resolves the problem, and also let me know if it accidentally resets the position to 0 if someone with MPC-HC joins a room which is part way through paying a fil.

@StefenStefan
Copy link

Hello, I had the same issue on mpv.net on the 1.7.1 version.

@soredake
Copy link
Contributor

Same issue for me, mpv.net and latest syncplay.

@Et0h
Copy link
Contributor

Et0h commented Mar 19, 2024

@StefenStefan @soredake

I use MPV.net with Syncplay all the time and have never had these issues.

To help understand and replicate the issues I'd like some more details please:

  1. What version of mpv.net are you using?
  2. How regularly does this happen?
  3. Does it take you to the position of the previously playing file?
  4. How many other people are in the room and what media players do they use?
  5. What file format are you playing?
  6. Are you playing the files from your hard drive?
  7. Does it correct itself or not?
  8. Does this issue only occur with the newer versions of Syncplay and/or MPV.net or is it a long running issue? Can you provide an example of a version which does not have this issue?
  9. Are you running on a relatively low spec or high spec computer?
  10. Are you using the public server or a private server? Do you have any latency or connection issues with that server?

@soredake
Copy link
Contributor

What version of mpv.net are you using?

7.1.1.0

How regularly does this happen?

Sometimes, not always.

Does it take you to the position of the previously playing file?

Yes.

How many other people are in the room and what media players do they use?

One, also using mpv.net (not the latest version, thought).

What file format are you playing?

mkv

Are you playing the files from your hard drive?

Last time this happened I switched from local file to local file.

Does it correct itself or not?

It does not.

Does this issue only occur with the newer versions of Syncplay and/or MPV.net or is it a long running issue? Can you provide an example of a version which does not have this issue?

It's an issue I have for years, although rarely experienced earlier, but now I am forced to switch files manually because of bug in trakt-scrobbler, so I see this problem more often.

Are you running on a relatively low spec or high spec computer?

High spec.

Are you using the public server or a private server? Do you have any latency or connection issues with that server?

This happened on official servers, unofficial server https://syncplay.343.re/ and on self-hosted instance too. No latency issues, I think, but I do have weird problem with my ISP connection where connection are randomly stuck for 20–40 seconds and then aborted.

@StefenStefan
Copy link

@Et0h

  1. v1.7.3
  2. Every time when going to the next item in the playlist
  3. Yes
  4. 2 people, both using mpv.net (I tried being alone in the room it was the same)
  5. mkv
  6. Yes, SSD
  7. No
  8. I believe it's the same for every version
  9. Ryzen 5 3600x, RX 590, 16GB Ram
  10. Public one - syncplay.pl:8997. No latency issues

@StefenStefan
Copy link

@Et0h

I just tested a lot of versions and it appears that the issue occurs from 1.6.5 Beta 1 and up.

Every version above that one has that issue.

I checked 1.6.4a, 1.6.4 and 1.6.3 - These are working fine, they don't have that bug.

@Et0h
Copy link
Contributor

Et0h commented Jun 9, 2024

@StefenStefan

Thanks to your information I've worked on a potential solution. Please test it and let me know if it fixes it for you: https://github.com/Syncplay/syncplay/actions/runs/9439659160

Technical details of the problem/solution

Thanks to your excellent testing I traced the likely culprit to this commit: 89ce72d

I believe that commit was created to fix an issue where Syncplay would erroneously reset when loading a file when you join a room and/or get a file in the playlist which you didn't previously have.

To fix it, I had to dig deep into the mpv logic, and found that when it is loading and tries to get the position it reverts to the global position. Now it returns 0 if it has been recently reset.

f people still experience problems I will have to modify the recentlyReset system to link to whether or not there has been a SyncplayUpdateFile since the last file upload attempt or something, but I'd rather not increase Syncplay's complexity if the current fix is enough.

@mbalandis
Copy link
Author

mbalandis commented Jun 10, 2024

@StefenStefan Thanks for fix a while ago, I haven't encountered any other bugs on latest versions of syncplay so far.

@StefenStefan
Copy link

@Et0h

Thank you for the response!

I'm not sure if I did everything correctly, I just downloaded 1.7.4 version and tested it (both portable and the installer one).

Unfortunately I'm still having the same issue.

Not sure if it helps but I tried using VLC and the bug is still present.

Please let me know if there is anything else you need me to test.

@Et0h
Copy link
Contributor

Et0h commented Jun 10, 2024

@StefenStefan Okay, please now try: https://github.com/Syncplay/syncplay/actions/runs/9453588544 - portable and installer should have same behaviour so you only need to test it once. This reverses a change I made during the relevant period 4 years ago (between 23 June 2019 and 30 May2020).

@StefenStefan
Copy link

@Et0h

Unfortunately the bug is still present. Tested with both mpv.net and VLC.

@Et0h
Copy link
Contributor

Et0h commented Jun 21, 2024

I've made a lot of changes to how playlist advancement and switching works on my test branch. Please let me know if this fixes your issue and/or if it introduces new bugs.

https://github.com/Syncplay/syncplay/actions/runs/9612802702

@StefenStefan
Copy link

Still the same, didn't notice any new bugs.

@soredake
Copy link
Contributor

7817185

With this commit, it's still not starts from beginning, but syncplay now quickly switches to beginning.

@Et0h
Copy link
Contributor

Et0h commented Jul 1, 2024

@soredake Progress! How quickly does it switch to the beginning? Before it switches, is it at the position of the previous video before you changed item or from a few seconds in? Also, is this a change in video from auto advancement at the end of an episode or manually switching?

@soredake
Copy link
Contributor

soredake commented Jul 1, 2024

How quickly does it switch to the beginning?

Almost instantly, and this happened only once so far.

Before it switches, is it at the position of the previous video before you changed item or from a few seconds in?

IIRC it was on the position of the previous video.

Also, is this a change in video from auto advancement at the end of an episode or manually switching?

This time it was manual switch to next item.

@soredake
Copy link
Contributor

soredake commented Jul 8, 2024

Happened again, now it's been auto-switch.

@Et0h
Copy link
Contributor

Et0h commented Jul 9, 2024

Happened again, now it's been auto-switch.

Could you provide more details about what you are experiencing and the relevant context please.

@soredake
Copy link
Contributor

soredake commented Jul 9, 2024

Next playlist is not started from the beginning, after switching to next item the time was at the end the current file, then after a second syncplay set time to beginning.

Et0h added a commit that referenced this issue Nov 18, 2024
* Re-introduce rewind double check

* Major re-work to playlist changing/advancement (#683 & #618)

* Remove stray print

* Fix mpv.net 'auto load folder' playlist advancement bug

* Update client.py to remove commented-out code
@Et0h
Copy link
Contributor

Et0h commented Nov 18, 2024

This issue is hopefully fixed by #698 which is now merged into the main Syncplay branch: https://github.com/Syncplay/syncplay/actions/runs/11900187832

Please let me know if you continue to have any problems.

@StefenStefan
Copy link

I'm so sorry, it still isn't working for me. I just tested earlier versions again (1.6.4a, 1.6.4, and 1.6.3) and unfortunately, they don't actually work. The reason it seemed to "work" for me and the bug was not present on those versions was that Syncplay would crash, leaving mpv.net open independently. I can't believe I didn't notice this during my initial testing. I sincerely apologize.

@Et0h
Copy link
Contributor

Et0h commented Dec 10, 2024

Thanks for the update @StefenStefan - Any potential fix will need plenty of testing, so it won't be able to make it into Syncplay 1.7.4 but it would be nice to be able to nail down this bug and fix it in a way that doesn't cause more problems than it solves.

@Et0h Et0h added help wanted Anyone willing to help can fix/implement this and removed Requires User Input Needs testing labels Dec 10, 2024
@StefenStefan
Copy link

If you need any help with testing, I would be happy to assist. Once again, I am really sorry for wasting your time with incorrect information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / problem help wanted Anyone willing to help can fix/implement this
Projects
None yet
Development

No branches or pull requests

4 participants