[packages/mpv] - upstream variant of the patch

arekm arekm at pld-linux.org
Thu Feb 20 15:43:52 CET 2020


commit 618fd57f36d27952148547a088d745bdf6375f25
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Feb 20 15:43:42 2020 +0100

    - upstream variant of the patch

 rtsp.patch | 58 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 47 insertions(+), 11 deletions(-)
---
diff --git a/rtsp.patch b/rtsp.patch
index da32337..8f82d6a 100644
--- a/rtsp.patch
+++ b/rtsp.patch
@@ -1,13 +1,49 @@
---- mpv-0.32.0/demux/demux_lavf.c.org	2020-02-19 22:38:35.401192350 +0100
-+++ mpv-0.32.0/demux/demux_lavf.c	2020-02-19 22:38:21.064094924 +0100
-@@ -1069,6 +1069,10 @@ static int demux_open_lavf(demuxer_t *de
-         demuxer->seekable = false;
- #endif
- 
-+    if (matches_avinputformat_name(priv, "rtsp")
-+            && priv->avfc->duration == AV_NOPTS_VALUE)
+From 6726b7a1ba5248e4edcab3dbd24c730551afb012 Mon Sep 17 00:00:00 2001
+From: wm4 <wm4 at nowhere>
+Date: Thu, 20 Feb 2020 15:28:49 +0100
+Subject: [PATCH] demux_lavf: signal no seeking for RTSP streams without
+ duration
+
+RTSP supports seeking, but at least the libavformat implementation makes
+this dependent on runtime behavior. So you have to perform a seek, and
+check if it fails. But even if you do this, the stream is interrupted
+and restarted, and there seem to be other issues.
+
+Assume that RTSP with unknown duration means it's a live stream, and
+disable seeking in this case, as suggested by the issue reporter.
+
+Fixes: #7472
+---
+ demux/demux_lavf.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
+index 62fecde8ea..fe127cdb08 100644
+--- a/demux/demux_lavf.c
++++ b/demux/demux_lavf.c
+@@ -146,6 +146,7 @@ struct format_hack {
+     bool is_network : 1;
+     bool no_seek : 1;
+     bool no_pcm_seek : 1;
++    bool no_seek_on_no_duration : 1;
+ };
+ 
+ #define BLACKLIST(fmt) {fmt, .ignore = true}
+@@ -174,6 +175,7 @@ static const struct format_hack format_hacks[] = {
+     {"matroska", .skipinfo = true, .no_pcm_seek = true, .use_stream_ids = true},
+ 
+     {"v4l2", .no_seek = true},
++    {"rtsp", .no_seek_on_no_duration = true},
+ 
+     // In theory, such streams might contain timestamps, but virtually none do.
+     {"h264", .if_flags = AVFMT_NOTIMESTAMPS },
+@@ -1090,6 +1092,9 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
+             demuxer->duration = duration;
+     }
+ 
++    if (demuxer->duration < 0 && priv->format_hack.no_seek_on_no_duration)
 +        demuxer->seekable = false;
 +
-     demuxer->is_network |= priv->format_hack.is_network;
-     demuxer->seekable &= !priv->format_hack.no_seek;
- 
+     // In some cases, libavformat will export bogus bullshit timestamps anyway,
+     // such as with mjpeg.
+     if (priv->avif_flags & AVFMT_NOTIMESTAMPS) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mpv.git/commitdiff/618fd57f36d27952148547a088d745bdf6375f25



More information about the pld-cvs-commit mailing list