changeset 36303:b50212f27ffa

Add support for rtsp:// falling back to support via FFmpeg.
author reimar
date Sun, 04 Aug 2013 13:30:42 +0000
parents 4508e308371a
children 6f0ab9dd1429
files libmpdemux/demux_lavf.c stream/stream.c stream/stream_ffmpeg.c
diffstat 3 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sun Aug 04 13:30:41 2013 +0000
+++ b/libmpdemux/demux_lavf.c	Sun Aug 04 13:30:42 2013 +0000
@@ -545,6 +545,8 @@
     if(demuxer->stream->url) {
         if (!strncmp(demuxer->stream->url, "ffmpeg://", 9))
             av_strlcpy(mp_filename, demuxer->stream->url + 9, sizeof(mp_filename));
+        else if (!strncmp(demuxer->stream->url, "rtsp://", 7))
+            av_strlcpy(mp_filename, demuxer->stream->url, sizeof(mp_filename));
         else
             av_strlcat(mp_filename, demuxer->stream->url, sizeof(mp_filename));
     } else
--- a/stream/stream.c	Sun Aug 04 13:30:41 2013 +0000
+++ b/stream/stream.c	Sun Aug 04 13:30:42 2013 +0000
@@ -105,6 +105,9 @@
 #endif
   &stream_info_rtp,
   &stream_info_udp,
+#ifdef CONFIG_FFMPEG
+  &stream_info_ffmpeg,
+#endif
   &stream_info_http2,
 #endif
 #ifdef CONFIG_DVBIN
@@ -139,9 +142,6 @@
 #ifdef CONFIG_LIBBLURAY
   &stream_info_bluray,
 #endif
-#ifdef CONFIG_FFMPEG
-  &stream_info_ffmpeg,
-#endif
 
   &stream_info_null,
   &stream_info_mf,
--- a/stream/stream_ffmpeg.c	Sun Aug 04 13:30:41 2013 +0000
+++ b/stream/stream_ffmpeg.c	Sun Aug 04 13:30:42 2013 +0000
@@ -25,6 +25,7 @@
 #include "m_option.h"
 #include "m_struct.h"
 #include "av_helpers.h"
+#include "libmpdemux/demuxer.h"
 
 static int fill_buffer(stream_t *s, char *buffer, int max_len)
 {
@@ -136,7 +137,9 @@
         stream->type = STREAMTYPE_STREAM;
         stream->seek = NULL;
     }
-    if (!dummy) {
+    if (dummy) {
+        *file_format = DEMUXER_TYPE_LAVF;
+    } else {
         stream->fill_buffer = fill_buffer;
         stream->write_buffer = write_buffer;
         stream->control = control;
@@ -154,7 +157,7 @@
   "",
   "",
   open_f,
-  { "ffmpeg", "rtmp", NULL },
+  { "ffmpeg", "rtmp", "rtsp", NULL },
   NULL,
   1 // Urls are an option string
 };