summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-22 02:40:29 +0200
committerwm4 <wm4@nowhere>2013-09-22 02:40:29 +0200
commitb0f7a26f1a6dc061db0a60908842371e7a010db2 (patch)
tree0bdd7490110da5e30edf7151f9949e67bff07e92 /mpvcore
parentce861c9f33fa17d2c9be64eb9e90b22a64dfd5a4 (diff)
downloadmpv-b0f7a26f1a6dc061db0a60908842371e7a010db2.tar.bz2
mpv-b0f7a26f1a6dc061db0a60908842371e7a010db2.tar.xz
network: fix rtsp playback
By default, libavformat uses UDP for rtsp playback. This doesn't work very well. Apparently the reason is that the buffer sizes libavformat chooses for UDP are way too small, and switching to TCP gets rid of this issue entirely (thanks go to Reimar Döffinger for figuring this out). In theory, you can set buffer sizes as libavformat options, but that doesn't seem to help. Add an option to select the rtsp transport, and make TCP the default. Also remove an outdated comment from stream.c.
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/options.c6
-rw-r--r--mpvcore/options.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/mpvcore/options.c b/mpvcore/options.c
index e3b3137aed..afeb7e80fa 100644
--- a/mpvcore/options.c
+++ b/mpvcore/options.c
@@ -382,6 +382,11 @@ const m_option_t mp_opts[] = {
{"referrer", &network_referrer, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"cookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"cookies-file", &cookies_file, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ OPT_CHOICE("rtsp-transport", network_rtsp_transport, 0,
+ ({"lavf", 0},
+ {"udp", 1},
+ {"tcp", 2},
+ {"http", 3})),
// ------------------------- demuxer options --------------------
@@ -794,6 +799,7 @@ const struct MPOpts mp_default_opts = {
.stream_cache_min_percent = 20.0,
.stream_cache_seek_min_percent = 50.0,
.stream_cache_pause = 10.0,
+ .network_rtsp_transport = 2,
.chapterrange = {-1, -1},
.edition_id = -1,
.default_max_pts_correction = -1,
diff --git a/mpvcore/options.h b/mpvcore/options.h
index d425d0789b..b1058fca37 100644
--- a/mpvcore/options.h
+++ b/mpvcore/options.h
@@ -98,6 +98,7 @@ typedef struct MPOpts {
int stream_cache_def_size;
float stream_cache_min_percent;
float stream_cache_seek_min_percent;
+ int network_rtsp_transport;
int stream_cache_pause;
int chapterrange[2];
int edition_id;