Skip to content

Commit 0df0dc0

Browse files
committed
Fix CI builds and seek-to-resume desync
- CMakeLists.txt: gate -Wl,--gc-sections behind NOT APPLE since macOS ld64 doesn't accept it. - tools/build-linux-release.sh: pass -Db_lto=false explicitly so a cached meson build dir (in CI) can't keep LTO on; ar/ranlib without the lto plugin silently dropped wayland interface symbols. - PlayerController.cpp: drop the rebase in playbackPositionFromMpvTime that added m_resumeStartSeconds to mpv's reported time when below the resume point. It made click-to-seek to a position before the resume point bounce back to the resume point on both Starfish and desktop. - PlayerController.cpp: use absolute+exact for click-committed seeks so they land on the requested frame instead of a distant keyframe; the scrub path still uses keyframes for low-latency drag feedback.
1 parent 6a9d2dd commit 0df0dc0

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,18 @@ if(NOT BUILD_SHARED_LIBS)
246246
Qt6::QJpegPlugin
247247
Qt6::QWebpPlugin
248248
)
249-
# Add linker GC to strip unused code from static libs
250-
target_link_options(jellyfin-native PRIVATE
251-
"-Wl,--gc-sections"
252-
)
253-
target_compile_options(jellyfin-native PRIVATE
254-
"-ffunction-sections"
255-
"-fdata-sections"
256-
)
249+
# Add linker GC to strip unused code from static libs.
250+
# macOS ld64 doesn't accept --gc-sections (uses -dead_strip instead, on by
251+
# default at -O), so only apply this on non-Apple platforms.
252+
if(NOT APPLE)
253+
target_link_options(jellyfin-native PRIVATE
254+
"-Wl,--gc-sections"
255+
)
256+
target_compile_options(jellyfin-native PRIVATE
257+
"-ffunction-sections"
258+
"-fdata-sections"
259+
)
260+
endif()
257261
endif()
258262

259263
set_target_properties(jellyfin-native PROPERTIES

‎src/player/PlayerController.cpp‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,13 @@ void PlayerController::seek(double seconds) {
464464
const double clampedSeconds =
465465
m_durationSeconds > 0.0 ? qBound(0.0, seconds, m_durationSeconds)
466466
: qMax(0.0, seconds);
467+
// Use absolute+exact so a committed click lands on the requested frame
468+
// instead of a possibly-distant keyframe. The optimistic-scrub path uses
469+
// keyframes for low latency during drag; commit needs precision.
467470
const QByteArray command =
468471
QByteArray("no-osd seek ") + QByteArray::number(clampedSeconds, 'f', 3) +
469-
QByteArray(" absolute+keyframes");
470-
qInfo() << "player: absolute keyframe seek" << clampedSeconds;
472+
QByteArray(" absolute+exact");
473+
qInfo() << "player: absolute exact seek" << clampedSeconds;
471474
beginSeekCommand(command, clampedSeconds);
472475
}
473476

@@ -894,13 +897,6 @@ void PlayerController::setPositionSeconds(double seconds) {
894897
double PlayerController::playbackPositionFromMpvTime(double seconds) const {
895898
if (!std::isfinite(seconds))
896899
return m_positionSeconds;
897-
898-
// Starfish can expose a timeline rebased to 0 after mpv starts a resumed
899-
// stream. Keep the app-facing clock on Jellyfin's absolute media timeline so
900-
// relative seeks and progress reports stay anchored to the resume point.
901-
if (m_resumeStartSeconds > 0.0 && seconds + 5.0 < m_resumeStartSeconds)
902-
return m_resumeStartSeconds + seconds;
903-
904900
return seconds;
905901
}
906902

‎tools/build-linux-release.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ MPV_SETUP_ARGS=(
2222
--prefix "$MPV_PREFIX"
2323
--buildtype release
2424
--default-library shared
25+
-Db_lto=false
2526
-Dbuild-date=false
2627
-Dlibmpv=true
2728
-Dcplayer=true

0 commit comments

Comments
 (0)