diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-07 00:39:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-07 00:39:54 +0200 |
commit | d68ed9f257bd9e76c6d615e03ba135a3df673712 (patch) | |
tree | 1933e5419841c5e5cc02ca4493e0c4151725f9af /libavformat/rtmpproto.c | |
parent | fc7d0d82017d67a1bbc0c1664144b756dc4ba6e3 (diff) | |
parent | 7ce3bd9614717e545af8fb8455032c807e389b78 (diff) | |
download | ffmpeg-d68ed9f257bd9e76c6d615e03ba135a3df673712.tar.gz |
Merge commit '7ce3bd9614717e545af8fb8455032c807e389b78'
* commit '7ce3bd9614717e545af8fb8455032c807e389b78':
rtmpproto: Support alternative slist parameter in rtmp URLs
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r-- | libavformat/rtmpproto.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 26c4d8e0bc..c8544efc8e 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2380,7 +2380,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) { RTMPContext *rt = s->priv_data; char proto[8], hostname[256], path[1024], auth[100], *fname; - char *old_app; + char *old_app, *qmark, fname_buffer[1024]; uint8_t buf[2048]; int port; AVDictionary *opts = NULL; @@ -2478,7 +2478,19 @@ reconnect: } //extract "app" part from path - if (!strncmp(path, "/ondemand/", 10)) { + qmark = strchr(path, '?'); + if (qmark && strstr(qmark, "slist=")) { + char* amp; + // After slist we have the playpath, before the params, the app + av_strlcpy(rt->app, path + 1, qmark - path); + fname = strstr(path, "slist=") + 6; + // Strip any further query parameters from fname + amp = strchr(fname, '&'); + if (amp) { + av_strlcpy(fname_buffer, fname, amp - fname + 1); + fname = fname_buffer; + } + } else if (!strncmp(path, "/ondemand/", 10)) { fname = path + 10; memcpy(rt->app, "ondemand", 9); } else { |