On 05/05/14 19:54, Martin Storsjö wrote:
> On Mon, 5 May 2014, Uwe L. Korn wrote:
> 
>> Support the URL scheme where the playpath is in an RTMP URL is
>> passed as the slist argument and the app is given infront of the
>> query part of the URL: rtmp://host[:port]/[app]?slist=[playpath].
> 
> Where is this convention normally used?

Actually I just realized that I'm struggeling to find alternative
documentation that is independent from rtmpdump or users that mention
these URLs in context with rtmpdump. This makes me a bit unsure if this
is really in use or is only made up by rtmpdump, sorry for the mess. I
will look out if I can find an independent reference, if not, feel free
to drop the patch. (Sadly there seems to be not so much rtmp
documentation freely available :( ).

>> ---
>> libavformat/rtmpproto.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
>> index 8d8aabc..028a366 100644
>> --- a/libavformat/rtmpproto.c
>> +++ b/libavformat/rtmpproto.c
>> @@ -2382,7 +2382,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;
>>     uint8_t buf[2048];
>>     int port;
>>     AVDictionary *opts = NULL;
>> @@ -2480,7 +2480,12 @@ reconnect:
>>     }
>>
>>     //extract "app" part from path
>> -    if (!strncmp(path, "/ondemand/", 10)) {
>> +    qmark = strchr(path, '?');
>> +    if (qmark && strstr(qmark, "slist=")) {
> 
> Can there be other "query parameters" here other than slist? If not, it
> would probably be better to use av_strstart to make sure that qmark
> starts with ?slist=. If other parameters are plausible and we'd be
> paranoid, we could also check that the char before what strstr returned
> is either ? or & - although that might be overkill here.

There can be other query parameters. What I realise is missing, is to
not to include other parameters in the playpath which are appended after
it, i.e. only the string between "slist=" and the next "&" should be set
to fname.

>> +        // After slist we have the playpath, before the params, the app
>> +        av_strlcpy(rt->app, path + 1, qmark - path);
>> +        fname = strstr(path, "slist=") + 6;
>> +    } else if (!strncmp(path, "/ondemand/", 10)) {
>>         fname = path + 10;
>>         memcpy(rt->app, "ondemand", 9);
>>     } else {
>> -- 
>> 1.9.2
> 
> All in all it looks quite ok I guess
> 
> // Martin
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to