[FFmpeg-devel] [PATCH] RTMPE support

Howard Chu hyc
Fri Mar 26 06:56:40 CET 2010


Kostya wrote:
> On Thu, Mar 25, 2010 at 09:06:51PM -0700, Howard Chu wrote:
>> M?ns Rullg?rd wrote:
>>> Right, that changes things a bit.  What you have there still isn't
>>> quite what you want.  Try this instead:
>>>
>>> RTMP-OBJS-$(CONFIG_LIBRTMP)   = librtmp.o
>>> RTMP-OBJS-$(!CONFIG_LIBRTMP)  = rtmpproto.o rtmppkt.o
>>> OBJS-$(CONFIG_RTMP_PROTOCOL) += $(RTMP-OBJS-yes)
>>
>> That works fine, thanks. Tested with both ffplay and mplayer (using
>> mplayer ffmpeg://rtmpe://foobar/ etc...)
>>
>> --
>>    -- Howard Chu
>
> [...]
>> Index: libavformat/librtmp.c
>> ===================================================================
>> --- libavformat/librtmp.c	(revision 0)
>> +++ libavformat/librtmp.c	(revision 0)
> [...]
>> +
>> +static int rtmp_close(URLContext * h)
>> +{
>> +    struct rtmp_state *rs = h->priv_data;
>> +
>> +    RTMP_Close(&rs->r);
>> +	av_free((void *)rs->r.Link.hostname);
>
> Looks like you have some tabs to replace with spaces.

Yes, that was the only one.

>> +    if (!RTMP_ParseURL(s->filename,&proto,&host,&port,&playpath,&app)) {
>> +            rc = -1;
>> +        goto fail;
>> +    }

>> +    if (playpath.av_len) {
>> +        if (rs->playpath.av_len) {
>> +            av_free(playpath.av_val);
>> +        } else {
>> +            rs->playpath = playpath;
>> +        }
>> +        playpath.av_val = NULL;
>> +        playpath.av_len = 0;
>> +    }

>> +fail:
>> +    av_free(host);
>> +    av_free(playpath.av_val);
>
> Where are those allocated? And have you tested this path?

In RTMP_ParseURL. Yes, this part is ugly, could be done differently. And yes, 
it works here.
>
>> +    av_free(rs);
>> +    return rc;
>> +}

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/



More information about the ffmpeg-devel mailing list