Bug 239905 - multimedia/mplayer: mkv seeking above 2GB broken with ffmpeg 4.2
Summary: multimedia/mplayer: mkv seeking above 2GB broken with ffmpeg 4.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-16 11:09 UTC by Christian Weisgerber
Modified: 2019-08-17 21:27 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (jbeich)


Attachments
avformat/matroskadec: Fix seeking (1.06 KB, patch)
2019-08-17 19:44 UTC, Christian Weisgerber
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Weisgerber freebsd_committer 2019-08-16 11:09:42 UTC
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

multimedia/mpv is not affected, so this appears to be a specific problem in MPlayer.

FreeBSD 12.0-STABLE r350672 GENERIC amd64
mplayer-1.4.0.20190706_2
ffmpeg-4.2_1,1
Compiled from ports with the default options.
Comment 1 Christian Weisgerber freebsd_committer 2019-08-17 19:43:42 UTC
I was mistaken.  This is indeed a bug in multimedia/ffmpeg.

Brad Smith provided a fix on OpenBSD:

"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."
Comment 2 Christian Weisgerber freebsd_committer 2019-08-17 19:44:43 UTC
Created attachment 206641 [details]
avformat/matroskadec: Fix seeking

Fix by Brad Smith (originally  for OpenBSD).
Comment 3 commit-hook freebsd_committer 2019-08-17 21:04:59 UTC
A commit references this bug:

Author: jbeich
Date: Sat Aug 17 21:04:33 UTC 2019
New revision: 509174
URL: https://svnweb.freebsd.org/changeset/ports/509174

Log:
  multimedia/ffmpeg: unbreak mkv seeking beyond 2gb after r508216

  PR:		239905
  Reported by:	naddy
  Obtained from:	upstream (release/4.2 branch)

Changes:
  head/multimedia/ffmpeg/Makefile
  head/multimedia/ffmpeg/files/patch-libavformat_matroskadec.c