[FFmpeg-devel] [PATCH] IRCAM demuxer
Daniel Verkamp
daniel at drv.nu
Wed Dec 5 06:32:41 CET 2012
On Tue, Dec 4, 2012 at 3:44 AM, Paul B Mahol <onemda at gmail.com> wrote:
> On 12/4/12, Daniel Verkamp <daniel at drv.nu> wrote:
>> On Mon, Dec 3, 2012 at 6:07 AM, Paul B Mahol <onemda at gmail.com> wrote:
>>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
[...]
>>> + if (!!le) {
>>> + sample_rate = av_int2float(avio_rl32(s->pb));
>>> + channels = avio_rl32(s->pb);
>>> + encoding = avio_rl32(s->pb);
>>> + } else if (!le) {
>>> + sample_rate = av_int2float(avio_rb32(s->pb));
>>> + channels = avio_rb32(s->pb);
>>> + encoding = avio_rb32(s->pb);
>>> + } else {
>>> + return AVERROR_INVALIDDATA;
>>> + }
>>
>> The else seems unlikely. :)
>
> It is still possible.
>
If !!le is 0, then !le is 1, and vice versa, so there is no possible
case where the else can be executed. I imagine the compiler probably
does not even emit the code for the return since it is unreachable.
Perhaps the confusion is with the initial -1 value of le: !-1 is 0,
and !!-1 is 1.
More information about the ffmpeg-devel
mailing list