diff options
author | wm4 <wm4@nowhere> | 2014-10-14 21:01:30 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-14 21:01:30 +0200 |
commit | 9241e1bf106f7ae5a6350fdbe602dda9aa390008 (patch) | |
tree | ea536adfc817df381d72b01d6b40eb9b829b8e20 /demux | |
parent | ffd3ae1fad2a63345a682635e8f2082e1d7475b7 (diff) | |
download | mpv-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')
-rw-r--r-- | demux/demux_lavf.c | 5 |
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) { |