summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-09-07 19:39:46 +0300
committerwm4 <wm4@nowhere>2012-10-28 17:35:56 +0100
commit6903319c6628ebd794c0f817e533276e60a194b3 (patch)
tree625083defdcbf72257e29c5ceac7948cd28cb31a /libmpdemux
parent60cbc9461b86b13c68cc9537bc9a124ddc07a399 (diff)
downloadmpv-6903319c6628ebd794c0f817e533276e60a194b3.tar.bz2
mpv-6903319c6628ebd794c0f817e533276e60a194b3.tar.xz
stream_ffmpeg: handle rtsp:// URLs by default, add lavf://
Make stream_ffmpeg handle rtsp:// URLs by default, without requiring ffmpeg://rtsp://. Previously (after removal of other rtsp implementations) rtsp:// fell back to using HTTP, which was unlikely to work. Also add lavf:// as an alternative to ffmpeg:// to force the stream implementation. Since libavformat can come from Libav rather than FFmpeg, using the ffmpeg name in the prefix is misleading.
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 5802f1068a..237d16a5c5 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -200,7 +200,8 @@ static int lavf_check_file(demuxer_t *demuxer)
mp_msg(MSGT_DEMUX, MSGL_WARN, "Stream url is not set!\n");
avpd.filename = "";
}
- if (!strncmp(avpd.filename, "ffmpeg://", 9))
+ if (!strncmp(avpd.filename, "ffmpeg://", 9) ||
+ !strncmp(avpd.filename, "lavf://", 7))
avpd.filename += 9;
avpd.buf_size = probe_data_size;
@@ -616,10 +617,12 @@ static demuxer_t *demux_open_lavf(demuxer_t *demuxer)
}
if (demuxer->stream->url) {
- if (!strncmp(demuxer->stream->url, "ffmpeg://rtsp:", 14))
- av_strlcpy(mp_filename, demuxer->stream->url + 9,
- sizeof(mp_filename));
- else
+ if (demuxer->stream->lavf_type && !strcmp(demuxer->stream->lavf_type,
+ "rtsp")) {
+ // Remove possible leading ffmpeg:// or lavf://
+ char *name = strstr(demuxer->stream->url, "rtsp:");
+ av_strlcpy(mp_filename, name, sizeof(mp_filename));
+ } else
av_strlcat(mp_filename, demuxer->stream->url, sizeof(mp_filename));
} else
av_strlcat(mp_filename, "foobar.dummy", sizeof(mp_filename));