[rtmpdump] [PATCH 1/2] librtmp/parseurl: ignore slashes past mp4:

Howard Chu hyc at highlandsun.com
Sat May 25 18:25:37 CEST 2013


Sebastian Andrzej Siewior wrote:
> On Sat, May 25, 2013 at 05:35:44PM +0300, Martin Storsjö wrote:
>> On Fri, 24 May 2013, Sebastian Andrzej Siewior wrote:
>>> rtmp://vod.daserste.de:8080/ardfs/mp4:videoportal/mediathek/Plusminus/c_320000/321891/format406703.mp4?&sen=Plusminus&clip=%27Al…
>>> app : 'ardfs/mp4:videoportal/mediathek'
>>> path: 'mp4:Plusminus/c_320000/321891/format406703?&sen=Plusminus&cl…
>> Well, the reason is pretty obvious - given a url like
>> rtmp://server/a/b/c/d/e/f, there's nothing that says which part is
>> the app and which is the playpath. So far the assumption has been to
>> use most of the path as app, and the rest as playpath (only taking a
>> fixed number of path segments probably because the implementation was
>> lazy or so). And changing it back would just break one case and fix
>> another one.
>
> I was under the assumption there is a standard but now I learned that this is
> not the case. So it is up to the server owner whatever he decides.
>
>> The fact that you can use mp4: or mp3: as indication of where the
>> playpath probably start is a better heuristic than what the lazy
>> implementation so far has done, and the patch looks good to me.
>> However, in general one can't expect the heuristic to handle every
>> single case - if in doubt one can always pass them separately.
>
> Would it be okay to add a little testsuite with a bunch of rtmp urls which
> checks if the app and path is parsed properly?

It is totally pointless. Users should just learn to explicitly pass the app 
and playpath and not rely on the builtin parser at all. In fact, I've a mind 
to revert all of the recent parsing patches back to my last version. If your 
particular usage fails to parse correctly, then you should manually retry.

It's a waste of developer time to focus on this. It's not a problem for real 
Flash clients because each SWF app is custom tailored to the service it's 
talking to, so they all already know how to parse their own URLs. Code like 
librtmp will never have this kind of knowledge due to its generality.

Going forward, we should, as a matter of course, discard all patches to the 
parsing code as a waste of time.



More information about the rtmpdump mailing list