summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-09 19:44:28 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-09 19:44:28 +0200
commitbc0f5249090cec1c460a910c2f46d2c760a2a3fe (patch)
tree91ea711bd517d7ebd21f96dc1e9e64da3e7953ac /libmpdemux
parenta1b84c208002a293e663673af26ccaf639ae726f (diff)
parentbc802c1e3efbe92cf653c415db5143291f096af4 (diff)
downloadmpv-bc0f5249090cec1c460a910c2f46d2c760a2a3fe.tar.bz2
mpv-bc0f5249090cec1c460a910c2f46d2c760a2a3fe.tar.xz
Merge svn changes up to r30502
Conflicts: libswscale/rgb2rgb.c libswscale/rgb2rgb.h libswscale/swscale.c libvo/x11_common.c
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index ad958889ed..6031b052fd 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -39,6 +39,7 @@
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include "libavutil/avutil.h"
+#include "libavutil/avstring.h"
#include "libavcodec/opt.h"
#include "mp_taglists.h"
@@ -154,13 +155,15 @@ static int lavf_check_file(demuxer_t *demuxer){
}
probe_data_size = stream_read(demuxer->stream, priv->buffer, PROBE_BUF_SIZE);
- if(probe_data_size <= 0)
+ if(probe_data_size < 0)
return 0;
avpd.filename= demuxer->stream->url;
+ if (!strncmp(avpd.filename, "ffmpeg://", 9))
+ avpd.filename += 9;
avpd.buf= priv->buffer;
avpd.buf_size= probe_data_size;
- priv->avif= av_probe_input_format(&avpd, 1);
+ priv->avif= av_probe_input_format(&avpd, probe_data_size > 0);
if(!priv->avif){
mp_msg(MSGT_HEADER,MSGL_V,"LAVF_check: no clue about this gibberish!\n");
return 0;
@@ -458,10 +461,13 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
}
}
- if(demuxer->stream->url)
- strncpy(mp_filename + 3, demuxer->stream->url, sizeof(mp_filename)-3);
- else
- strncpy(mp_filename + 3, "foobar.dummy", sizeof(mp_filename)-3);
+ if(demuxer->stream->url) {
+ if (!strncmp(demuxer->stream->url, "ffmpeg://rtsp:", 14))
+ av_strlcpy(mp_filename, demuxer->stream->url + 9, sizeof(mp_filename));
+ else
+ av_strlcat(mp_filename, demuxer->stream->url, sizeof(mp_filename));
+ } else
+ av_strlcat(mp_filename, "foobar.dummy", sizeof(mp_filename));
priv->pb = av_alloc_put_byte(priv->buffer, BIO_BUFFER_SIZE, 0,
demuxer->stream, mp_read, NULL, mp_seek);