On Sat, Aug 17, 2019 at 04:28:31PM +0200, Christian Weisgerber wrote:
> The update to FFmpeg 4.2 has introduced a regression in MPlayer. For (at
> least) the ubiquitous H.264 videos in MKV containers, seeking in MPlayer
> is broken, e.g. when jumping back and forth with the arrow keys. Effects
> are desynchronized faulty video and failure to seek. This appears to
> affect the parts of the video file beyond 2GB, seeking below is fine.
> MPlayer prints warnings like
> [matroska,webm @ 0x801b86f40]Element at 0x81e78160 ending at 0x81ff3e32
> exceeds containing master element ending at 0x7e2ea500
Does this resolve the issue?
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/graphics/ffmpeg/Makefile,v
retrieving revision 1.190
diff -u -p -u -p -r1.190 Makefile
--- Makefile 17 Aug 2019 08:23:50 -0000 1.190
+++ Makefile 17 Aug 2019 15:57:05 -0000
@@ -4,6 +4,7 @@ COMMENT= audio/video converter and strea
V= 4.2
DISTNAME= ffmpeg-${V}
+REVISION= 0
EPOCH= 0
CATEGORIES= graphics multimedia
MASTER_SITES= https://ffmpeg.org/releases/
Index: patches/patch-libavformat_matroskadec_c
===================================================================
RCS file: patches/patch-libavformat_matroskadec_c
diff -N patches/patch-libavformat_matroskadec_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libavformat_matroskadec_c 17 Aug 2019 16:00:11 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+avformat/matroskadec: Fix seeking
+
+matroska_reset_status (a function that is used during seeking (among
+other things)) used an int for the return value of avio_seek which
+returns an int64_t. Checking the return value then indicated an error
+even though the seek was successfull for targets in the range of
+2GB-4GB, 6GB-8GB, ... This error implied that the status hasn't been
+reset and in particular, the old level was still considered to be in
+force, so that ebml_parse returned errors because the newly parsed
+elements were of course not contained in the previously active and still
+wrongly considered active master element any more.
+
+Index: libavformat/matroskadec.c
+--- libavformat/matroskadec.c.orig
++++ libavformat/matroskadec.c
+@@ -757,7 +757,7 @@ static int matroska_reset_status(MatroskaDemuxContext
+ uint32_t id, int64_t position)
+ {
+ if (position >= 0) {
+- int err = avio_seek(matroska->ctx->pb, position, SEEK_SET);
++ int64_t err = avio_seek(matroska->ctx->pb, position, SEEK_SET);
+ if (err < 0)
+ return err;
+ }