summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-03-02 19:07:12 +0100
committerJan Ekström <jeebjp@gmail.com>2018-03-03 02:38:01 +0200
commit0200a71e2f40b26cbd9bd956089857205e72c6e5 (patch)
treec5b1aa2ab423a45d379af3d010f3bd3abfaf5555
parent8ce5e794fb46f66fd283044cdd983f838daafb45 (diff)
downloadmpv-0200a71e2f40b26cbd9bd956089857205e72c6e5.tar.bz2
mpv-0200a71e2f40b26cbd9bd956089857205e72c6e5.tar.xz
demux_lavf: add some hacks for SDP
Just the usual guess-what-opaque-ffmpeg-thing-supports. See #5550. It looks like we can reduce packet drop by having the cache enabled automatically.
-rw-r--r--demux/demux_lavf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 4e1e3067ea..27c5f5087f 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -136,6 +136,8 @@ struct format_hack {
bool clear_filepos : 1;
bool ignore_start : 1;
bool fix_editlists : 1;
+ bool is_network : 1;
+ bool no_seek : 1;
};
#define BLACKLIST(fmt) {fmt, .ignore = true}
@@ -153,6 +155,7 @@ static const struct format_hack format_hacks[] = {
{"hls", .no_stream = true, .clear_filepos = true},
{"dash", .no_stream = true, .clear_filepos = true},
+ {"sdp", .clear_filepos = true, .is_network = true, .no_seek = true},
{"mpeg", .use_stream_ids = true},
{"mpegts", .use_stream_ids = true},
@@ -935,6 +938,9 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
demuxer->seekable = false;
#endif
+ demuxer->is_network |= priv->format_hack.is_network;
+ demuxer->seekable &= !priv->format_hack.no_seek;
+
if (priv->avfc->duration > 0) {
demuxer->duration = (double)priv->avfc->duration / AV_TIME_BASE;
} else {