Seeking in HEVC/H.265 MKV files can cause xine playback to become severely corrupted immediately after the seek. Playback begins to stutter, frames may appear almost completely white/corrupted, and xine may subsequently stop playback or crash.
The problem has been reproduced with two completely different encodes of the same movie, including one approximately 15 GB and another approximately 3 GB.
The same files seek and resume playback correctly in VLC and mpv.
The problem also occurs when VDPAU/NVDEC hardware decoding is disabled, so it does not appear to be specific to NVIDIA hardware decoding.
OS: Debian 13, x86_64
Desktop: KDE Plasma / X11
GPU: NVIDIA GeForce RTX 4070 Laptop GPU
NVIDIA driver: 550.163.01
xine-ui: 0.99.14
FFmpeg: 7.1.5-0+deb13u1
libavcodec: 61.19.101
libavformat: 61.7.103
One of the reproducible files is a Matroska file containing:
A second, unrelated encode of the same movie, approximately 3 GB in size, exhibits the same xine behaviour.
Start xine with network control enabled:
xine -n <HEVC-MKV-file>
Connect with xine-remote and perform a large seek, for example:
seek +4600
or:
seek %50
The seek itself may complete quickly, but playback immediately afterwards becomes unstable.
Observed behaviour includes:
When playback terminates without the main xine process exiting, xine-remote reports:
Current status: XINE_STATUS_STOP
Current position: 1
Current length: 1
After seeking, xine repeatedly reports errors such as:
[hevc @ ...] Could not find ref with POC 38
[hevc @ ...] Could not find ref with POC 34
[hevc @ ...] Could not find ref with POC 30
[hevc @ ...] Could not find ref with POC 27
[hevc @ ...] Could not find ref with POC 46
[hevc @ ...] Could not find ref with POC 42
[hevc @ ...] Could not find ref with POC 8
[hevc @ ...] Could not find ref with POC 4
[hevc @ ...] Could not find ref with POC 0
The errors continue with numerous different POC values.
This appears consistent with the HEVC decoder not having the reference pictures it expects following a seek.
Initially the problem was reproduced while xine was using VDPAU/NVIDIA hardware decoding.
I then changed xine's decoder setting from VDPAU to Auto and verified with nvidia-smi that xine was no longer using NVDEC.
The same behaviour remained:
seek +4600
-> seek succeeds
-> playback starts stuttering/corrupting
-> xine eventually stops or crashes
Therefore this does not appear to be specific to VDPAU/NVDEC.
The original file was initially played over NFS from a NAS.
To eliminate NFS and the NAS as possible causes, the complete file was copied to a locally attached 4 TB USB disk and played from there.
The behaviour was unchanged.
The original approximately 15 GB MKV initially also exhibited extremely slow/hanging seeks.
It was remuxed without transcoding using:
mkvmerge -o dnd-remux.mkv original.mkv
mkvmerge completed successfully and regenerated the Matroska cue entries.
After remuxing, seeking itself became essentially instantaneous in xine (less than one second).
However, xine still produced the HEVC "Could not find ref with POC" errors after the seek, followed by corrupted/stuttering playback and eventual playback termination.
Therefore there appeared to be two separate issues with that particular source file:
The remuxed file was tested independently with FFmpeg:
ffmpeg -ss 01:16:40 -i dnd-remux.mkv -t 10 -f null -
FFmpeg successfully performed the seek and decoded 10 seconds / 240 frames.
Result:
frame=240 ... time=00:00:10.00 ... speed=6.31x
There were no "Could not find ref with POC" errors during this test.
The remuxed MKV was also tested with mpv.
mpv seeks to approximately the same location and continues playing normally and stably afterwards.
VLC also seeks and resumes playback normally.
A second, unrelated approximately 3 GB MKV encode of the same movie was then tested.
xine exhibits the same post-seek failure with this second encode, while VLC seeks and continues playing normally.
This makes the issue unlikely to be specific to the original MKV file, its size, its cue table, the storage medium, or a particular encode.
The evidence appears to point toward xine/xine-lib's HEVC decoder state handling following a seek.
In particular, after a seek xine/libavcodec reports missing HEVC reference pictures ("Could not find ref with POC ..."), while current FFmpeg, mpv and VLC are able to seek into the same files and continue decoding normally.
The issue is reproducible without VDPAU/NVDEC hardware decoding.
I can provide additional xine logs, MediaInfo/mkvinfo output or a stack trace/coredump if useful.