From 6903319c6628ebd794c0f817e533276e60a194b3 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 7 Sep 2012 19:39:46 +0300 Subject: 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. --- libmpdemux/demux_lavf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libmpdemux/demux_lavf.c') 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)); -- cgit v1.2.3