Skip to content

Commit

Permalink
Fix seeking to end using seek bar
Browse files Browse the repository at this point in the history
Merging AntennaPod#6074 has caused a new edge case for VBR audio files, in which
using the seek bar to seek to the end of an episode sometimes hits the
new code path, and the `skip()` function is called.

Because `skip()` invokes `endPlayback()` with `hasEnded` set to `false`,
post-processing tasks are not executed unless the pre-seek position
falls within the "Smart mark as played" range. If "Smart mark as played"
is set to `Disabled`, or the pre-seek position is outside that range,
then the episode is not marked as played, and not removed from queue.

This commit fixes that edge case by replacing `skip()` with a direct
call to `endPlayback()`, with `hasEnded` set to `true`.
  • Loading branch information
terminalmage committed Nov 14, 2023
1 parent 46c3d4e commit b1cba9c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -345,7 +345,7 @@ public void seekTo(int t) {

if (t >= getDuration()) {
Log.d(TAG, "Seek reached end of file, skipping to next episode");
skip();
endPlayback(true, true, true, true);
return;
}

Expand Down

0 comments on commit b1cba9c

Please sign in to comment.