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

WIP: Continue work on input_cache #1047

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TilCreator
Copy link

(This pr is mostly for seeing what this fork is doing since that is hard to see on github.)

My fixes are mostly wip, see the TODOs for further information.
In my tests I was able to use an unstable sshfs connection (make shure to use the timeout options so that the fs calls actually fail).
I also tested with curl / webdav (Remove /src/input/cache/Manager.cxx:97-98 for that), but that somehow still fails even if cached, didn't look further into it.

I will continue working on this, but probably not fast. So help with the TODOs (also ideas how to fix them) and more are welcome.

@@ -114,7 +114,7 @@ struct playlist {
int GetCurrentPosition() const noexcept;

gcc_pure
int GetNextPosition() const noexcept;
int GetNextPosition(unsigned index) const noexcept;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document this - the method is currently completely undocumented, that's bad already (sorry...)...

else if (queue.IsValidOrder(current + 1))
return queue.OrderToPosition(current + 1);
else if (queue.IsValidOrder(current + index))
return queue.OrderToPosition(current + index);
else if (queue.repeat)
return queue.OrderToPosition(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete: in repeat mode, this should properly calculate the overflow

@@ -114,7 +114,7 @@ struct playlist {
int GetCurrentPosition() const noexcept;

gcc_pure
int GetNextPosition() const noexcept;
int GetNextPosition(unsigned index) const noexcept;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have index=1 as default value, so existing callers don't need to be migrated?
Maybe rename the parameter to offset?

@@ -80,7 +80,7 @@ PrefetchSong(InputCacheManager &cache, const char *uri) noexcept
static void
PrefetchSong(InputCacheManager &cache, const DetachedSong &song) noexcept
{
PrefetchSong(cache, song.GetURI());
PrefetchSong(cache, song.GetRealURI());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message isn't good - it doesn't explain what needs to be fixed, and why this change fixes the issue.

@@ -225,6 +228,7 @@ Partition::OnIdleMonitor(unsigned mask) noexcept
void
Partition::OnGlobalEvent(unsigned mask) noexcept
{
// TODO This doesn't seam to trigger when the random property of the queue is changed, this is needed for the pre caching
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A "sync with player" is only needed if the one next song changes; the player doesn't care for anything but the current and the next song. And the next song only if it has already finished decoding the current one; then it will start decoding the next one. That's why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants