path: root/stream
diff options
authorwm4 <wm4@nowhere>2012-12-01 23:52:04 +0100
committerwm4 <wm4@nowhere>2012-12-03 21:08:52 +0100
commitc02f2529385ab2ddd9605c5ebe5d2a68be200ec4 (patch)
tree360218c41694cf931f0607b64d0e7bc36684ef1c /stream
parent6294c785490be5fc31d29758ca592510fd161371 (diff)
stream_lavf: use ffmpeg for http/https streaming
The internal mplayer http implementation is terrible and old. Try to use ffmpeg instead. Enable ffmpeg https as well (we don't have native support for it and never will). Enable the cache for ffmpeg streams. In theory, we want to enable the cache for network streams only (or at least, not enable it for files), but there doesn't seem to be any way to query this. ffmpeg has its own read-cache, but apparently it doesn't get filled asynchronously (only to the degree internal socket/kernel buffers do). Should it turn out that the mplayer implementation is better than ffmpeg's in some way (unlikely), this commit might be reverted until ffmpeg is ready. So far, the ffmpeg implementation seems to work very well though. The original mplayer stream implementation is made available under "mp_http://" and "mp_http_proxy://". This is for testing, until the http implementation is completely removed. Note that this is unlikely to happen soon: ffmpeg doesn't support Microsoft streaming, while mplayer has some support. This code has dependencies on http. Note: "http_proxy://" doesn't work anymore. Use "httpproxy://" to get the ffmpeg implementation of it. Using https requires enabling OpenSSL in ffmpeg by adding the --enable-openssl switch to ffmpeg's configure.
Diffstat (limited to 'stream')
2 files changed, 5 insertions, 3 deletions
diff --git a/stream/http.c b/stream/http.c
index 8b71435d2f..11fe7ed6de 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -938,7 +938,7 @@ const stream_info_t stream_info_http1 = {
"Bertrand, Albeau, Reimar Doeffinger, Arpi?",
"plain http",
- {"http", "http_proxy", "unsv", "icyx", "noicyx", NULL},
+ {"mp_http", "mp_http_proxy", "unsv", "icyx", "noicyx", NULL},
0 // Urls are an option string
@@ -949,7 +949,7 @@ const stream_info_t stream_info_http2 = {
"Bertrand, Albeu, Arpi? who?",
"plain http, also used as fallback for many other protocols",
- {"http", "http_proxy", "pnm", "mms", "mmsu", "mmst", "rtsp", NULL}, //all the others as fallback
+ {"mp_http", "mp_http_proxy", "pnm", "mms", "mmsu", "mmst", "rtsp", NULL}, //all the others as fallback
0 // Urls are an option string
diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c
index 6e5f70ae83..4c7e5a7c40 100644
--- a/stream/stream_lavf.c
+++ b/stream/stream_lavf.c
@@ -152,6 +152,8 @@ static int open_f(stream_t *stream, int mode, void *opts, int *file_format)
stream->write_buffer = write_buffer;
stream->control = control;
stream->close = close_f;
+ // enable cache (should be avoided for files, but no way to detect this)
+ stream->streaming = true;
res = STREAM_OK;
@@ -164,7 +166,7 @@ const stream_info_t stream_info_ffmpeg = {
- { "lavf", "ffmpeg", "rtmp", "rtsp", NULL },
+ { "lavf", "ffmpeg", "rtmp", "rtsp", "http", "https", NULL },
1 // Urls are an option string