[FFmpeg-devel] Realmedia patch

Ronald S. Bultje rsbultje
Mon Sep 1 01:23:31 CEST 2008


Hi,

On Sun, Aug 31, 2008 at 7:19 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Aug 31, 2008 at 11:43:59AM -0400, Ronald S. Bultje wrote:
>> @@ -85,8 +97,24 @@
>>  ff_rdt_subscribe_rule (void *d, char *cmd, int size,
>>                         int stream_nr, int rule_nr)
>>  {
>> -    av_strlcatf(cmd, size, "stream=%d;rule=%d,stream=%d;rule=%d",
>> -                stream_nr, rule_nr, stream_nr, rule_nr + 1);
>> +    rdt_data *rdt = d;
>> +    int i, first = 1;
>> +
>> +    assert(rule_nr >= 0 && rule_nr < rdt->n_rules);
>> +    for (i = 0; i < rdt->n_rules; i++) {
>> +        if (i == rule_nr ||
>> +            !strcmp(rdt->rule[i].condition, rdt->rule[rule_nr].condition)) {
>> +            if (first)
>> +                first = 0;
>> +            else
>> +                av_strlcat(cmd, ",", size);
>> +
>> +            av_strlcatf(cmd, size, "stream=%d;rule=%d", stream_nr, i);
>> +#ifdef ASM_RULEBOOK_DEBUG
>> +            printf("Subscribe to stream:%d,rule:%d\n", stream_nr, i);
>> +#endif
>
> printf() ?
> also, no i do not agree to this ifdeffery
> use dprintf() or whatever

Is it bad for performance if I use av_log(DEBUG) for this kind of
stuff? I'm also interested in transforming some #ifdef'ed printf()s in
rtsp.c into av_log(DEBUG)s, they contain useful debug information and
it sucks to have to recompile to get that out.

Ronald




More information about the ffmpeg-devel mailing list