Repository navigation
mpris: report the correct position in Seeked - #1522
Merged
Merged
Conversation
Closed
pgaskin
force-pushed
the
mpris-seek-pos
branch
3 times, most recently
from
September 24, 2026 05:54
af407ce to
cf39369
Compare
pgaskin
commented
Sep 24, 2026
pgaskin
left a comment
Member
Author
There was a problem hiding this comment.
I've tested this locally.
flyingmutant
force-pushed
the
mpris-seek-pos
branch
from
October 3, 2026 12:16
cf39369 to
5c6a3cc
Compare
Member
|
Maybe we'd need something like this to clear pending seek info when changing tracks? --- a/player.c
+++ b/player.c
@@ -413,7 +413,7 @@
/* updating player status {{{ */
-static inline void _file_changed(struct track_info *ti)
+static inline void _file_changed(struct track_info *ti, int reset_seek)
{
player_info_priv_lock();
if (player_info_priv.ti)
@@ -423,6 +423,8 @@
update_rg_scale();
player_metadata[0] = 0;
player_info_priv.file_changed = 1;
+ if (reset_seek)
+ player_info_priv.position_seeked = 0;
player_info_priv_unlock();
}
@@ -433,7 +435,7 @@
} else {
d_print("unloaded\n");
}
- _file_changed(ti);
+ _file_changed(ti, 1);
}
static inline void metadata_changed(void)
@@ -1228,7 +1230,8 @@
void player_file_changed(struct track_info *ti)
{
- _file_changed(ti);
+ _file_changed(ti, 0);
}
void player_seek(double offset, int relative, int start_playing) |
And don't block the consumer while emitting it. Instead of reading player_info.pos (which is always outdated since it is updated by player_info_snapshot), set a flag in player_info_priv and emit the signal after the next snapshot, like the other MPRIS signals. Note that Seeked is no longer emitted for failed seeks. A pending seek is also discarded if the track changes before the next snapshot, so Seeked is not emitted with the previous track's position. Co-Authored-By: Patrick Gaskin <[email protected]> Co-Authored-By: Gregory Petrosyan <[email protected]>
pgaskin
force-pushed
the
mpris-seek-pos
branch
from
October 10, 2026 08:15
5c6a3cc to
e354205
Compare
Member
Author
|
Done and tested, @flyingmutant. |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
And don't block the consumer while emitting it.
Instead of reading player_info.pos (which is always outdated since it is updated by player_info_snapshot), set a flag in player_info_priv and emit the signal after the next snapshot, like the other MPRIS signals.
Note that Seeked is no longer emitted for failed seeks.
closes #1408 (based on it, plus some fixes)