On 29/04/14 13:43, Martin Storsjö wrote:
> On Sat, 26 Apr 2014, Luca Barbato wrote:
>
>> Makes the two protocols nearly seamless.
>> ---
>>
>> Removed unmapped options, mapped swfverify, always try to map the
>> options.
>>
>> libavformat/librtmp.c | 141
>> ++++++++++++++++++++++++++++++++++++++++++++------
>> 1 file changed, 125 insertions(+), 16 deletions(-)
>>
>
>> + if (ctx->swfurl || ctx->swfverify)
>> + av_strlcat(filename, " swfUrl=", len);
>> +
>> + if (ctx->swfverify) {
>> + av_strlcat(filename, ctx->swfverify, len);
>> + av_strlcat(filename, " swfVfy=1", len);
>> + }
>> + if (!ctx->swfverify && ctx->swfurl)
>> + av_strlcat(filename, ctx->swfurl, len);
>
> This part feels a bit hard to read. What about this instead?
>
> if (ctx->swfurl || ctx->swfverify) {
> av_strlcat(filename, " swfUrl=", len);
> av_strlcat(filename, ctx->swfverify ? ctx->swfverify : ctx->swfurl,
> len);
> if (ctx->swfverify)
> av_strlcat(filename, " swfVfy=1");
> }
>
> That at least to me is much more straightforward about what really
> happens. If people dislike the ternary operator that line could be a
> separate if though, but it makes it clearer to me what actually happens.
> Something similar probably can be done for the string length calculation
> further up.
I'd update using the separate if there and above.
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel