[Android] Bug: resuming an MKV HTTP stream from history lands near 0:00 (resume seek runs before video is enabled)

bobdoledoesntneedthis bobdoledoesntneedthis at proton.me
Mon Nov 9 01:24:19 UTC 2026


Hello,

I'd like to report a bug in VLC for Android. I registered on code.videolan.org in October to file it there, but my account is still awaiting approval, so I'm sending it to this list as the README suggests. I'll post it as an issue once the account is approved.

I searched the vlc-android and vlc issue trackers (most recently on November 8) and found no existing report. The 3.7.2 changelog doesn't mention it, and the relevant app code is unchanged on master.

Three log excerpts are attached (vlc-resume-logs.tar.xz). The stream URL, file name, server address and HTTP auth headers have been redacted. The full logcat captures are available on request.


Summary
-------

Resuming an MKV network stream from history restarts near 0:00 (fast seek on) or prerolls from 0:00 (fast seek off): the resume seek runs while video is disabled.


Description
-----------

Resuming an MKV played over HTTP from the Stream history does not resume at the saved position.

- With Settings > "Always use fast seek" enabled, playback restarts a few seconds into the file. Sometimes the correct position flashes briefly first.

- With fast seek disabled, the player shows the loading cone for a long time (66 s in one run) while it decodes from the start of the file up to the resume point. On a slower or interrupted connection it never gets there: in one run the HTTP connection dropped mid-preroll and playback ended with EOF.

The same file downloaded to local storage resumes correctly. Once playback is running, manual seeks on the stream are instant and accurate.

Expected: playback resumes at the saved position, as it does for a local file.

Actual: the resume seek lands on a keyframe near the beginning of the file.


Analysis (from verbose logs and source)
---------------------------------------

1. A history stream is not TYPE_VIDEO, so PlaylistManager.playIndex() starts it in the service without the MEDIA_VIDEO flag, and VLCOptions.setMediaOptions() adds ":no-video". The log shows "video is disabled, not selecting ES" at open. switchToVideo() enables video only about 0.5 s later, after ESAdded.

2. The resume position is applied through ":start-time" during this video-less window. In matroska_segment_c::Seek() (modules/demux/mkv/matroska_segment.cpp), "priority" falls back to the selected tracks when no video track is selected, which here is only the audio track. The file's Cues reference only the video track (the usual mkvmerge layout), and the only audio seekpoints known at that point are the ones already read near the start, so the seek resolves to "fpos 6374, pts 0".

3. When the video player attaches, the app seeks again to the current time. This seek follows "Always use fast seek", which suggests PlaybackService.flush() via setTime(..., fast). Video is still not selected at that instant, so it resolves to an audio seekpoint about 5-6 s in:
   - Fast seek on: playback starts at about 0:05.
   - Fast seek off: an accurate seek from about 0:06 decodes and discards about 10 minutes of 1080p over HTTP (about 700 MB) before showing anything.

4. Later user seeks, with video selected, resolve correctly from the Cues. For example, a seek to 442 s resolves to the keyframe at 440.44 s with tracks 1, 2 and 4.

Possible fixes:

- App: open history network streams that turn out to be video with video enabled, or apply the resume time only after the video track is selected. With libVLC 4 this could use set_time instead of start-time, as the existing TODO in PlaylistManager notes.

- mkv demux: when no video track is selected, still use the video tracks' cue points to choose the file position.


Steps to reproduce
------------------

1. Enable "Always use fast seek".
2. Play an MKV (H.264 + E-AC3, Cues on the video track only) from an HTTP server, entered as a network stream.
3. Seek to about 10:00, let it play a few seconds, then exit the player.
4. Reopen the same item from Streams / history.
5. Playback starts at about 0:05 instead of about 10:00. Repeat with fast seek off: the loading cone stays for a long time while the input prerolls from about 0:06.


Logs (attached, verbose mode, logcat)
-------------------------------------

- report-excerpt-fastseek-on.txt: reopen with fast seek on. "starting at time: 621s" -> "SET_TIME to 621000000" -> "preroll{ track: 2 ... fpos: 6374 }" -> app "SET_TIME to 621398000" -> "preroll{ req: 5184001, start-pts: 5184001 }", i.e. playback starts at 5.2 s.

- report-excerpt-fastseek-off-66s.txt: reopen with fast seek off. "SET_TIME to 623817000" -> "preroll{ req: 623817001, start-pts: 5440001 }" -> "Stream buffering done (619935 ms in 66339 ms)".

- report-excerpt-fastseek-off.txt: same as above, but the HTTP connection failed during the preroll: "Error while reading SimpleBlock" -> "EOF reached".

Key lines from the fast-seek-on run:

  21:31:23.853 libvlc input: starting at time: 621s
  21:31:23.854 libvlc input: video is disabled, not selecting ES 0x0
  21:31:23.872 libvlc demux: SET_TIME to 621000000
  21:31:23.873 libvlc demux: seek: preroll{ req: 621000001, start-pts: 1, start-fpos: 6374}
  21:31:24.142 Displayed org.videolan.vlc/.gui.video.VideoPlayerActivity
  21:31:24.193 libvlc demux: SET_TIME to 621398000
  21:31:24.194 libvlc demux: seek: preroll{ req: 5184001, start-pts: 5184001, start-fpos: 3997695}
  21:31:24.464 libvlc decoder: using video decoder module "mediacodec"


Context
-------

App version:     3.7.1 (13070105, F-Droid build), libVLC 3.0.23
Android version: 12
Device:          SEI Robotics FRC1-Eastlink (SEI800ESTL), armeabi-v7a, Android TV set-top box
App mode:        TV

Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vlc-resume-logs.tar.xz
Type: application/x-xz
Size: 12460 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/android/attachments/20261109/128869a5/attachment.xz>


More information about the Android mailing list