summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-14 21:01:30 +0200
committerwm4 <wm4@nowhere>2014-10-14 21:01:30 +0200
commit9241e1bf106f7ae5a6350fdbe602dda9aa390008 (patch)
treeea536adfc817df381d72b01d6b40eb9b829b8e20 /demux/demux_lavf.c
parentffd3ae1fad2a63345a682635e8f2082e1d7475b7 (diff)
downloadmpv-9241e1bf106f7ae5a6350fdbe602dda9aa390008.tar.bz2
mpv-9241e1bf106f7ae5a6350fdbe602dda9aa390008.tar.xz
demux_lavf: set stream network options if applicable
Normally, we pass libavformat demuxers a wrapped mpv stream. But in some cases, such as HLS and RTSP, we let libavformat open the stream itself. In these cases, set typical network properties like useragent according to the mpv options. (We still don't set it for the cases where libavformat opens other streams on its own, e.g. when opening the companion .sub file for .idx files - not sure if we maybe should always set these options.)
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index ddec27f66d..85db0692e8 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -706,10 +706,13 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
"analyzeduration to %f\n", analyze_duration);
}
+ AVDictionary *dopts = NULL;
+
if ((priv->avif->flags & AVFMT_NOFILE) ||
demuxer->stream->type == STREAMTYPE_AVDEVICE ||
matches_avinputformat_name(priv, "hls"))
{
+ mp_setup_av_network_options(&dopts, demuxer->global, demuxer->log, opts);
// This might be incorrect.
demuxer->seekable = true;
} else {
@@ -727,8 +730,6 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
avfc->pb = priv->pb;
}
- AVDictionary *dopts = NULL;
-
if (matches_avinputformat_name(priv, "rtsp")) {
const char *transport = NULL;
switch (opts->network_rtsp_transport) {