Re: [FFmpeg-devel] [PATCH 2/3] lavf/aviobuf: make AVSEEK_SIZE usable from outside.

2019-07-19 Thread Michael Niedermayer
On Fri, Jul 19, 2019 at 11:49:04PM +0200, Nicolas George wrote: > Michael Niedermayer (12019-07-19): > > > +if ((whence & AVSEEK_SIZE)) > > redundant () > > I use it as a marker that it is not a mistake for &&. IIRC, gcc (with > some options) warns about "if (a & b)" but accepts "if ((a & b))"

Re: [FFmpeg-devel] [PATCH 2/3] lavf/aviobuf: make AVSEEK_SIZE usable from outside.

2019-07-19 Thread Nicolas George
Hendrik Leppkes (12019-07-20): > That seems like a particularly dumb compiler "feature". Checking > bitmasks for a set bit seems like a rather standard if condition. Maybe, to each their own, but it saved me a few times, so personally I like it, especially since the double-parentheses is an obviou

Re: [FFmpeg-devel] [PATCH 2/3] lavf/aviobuf: make AVSEEK_SIZE usable from outside.

2019-07-19 Thread Hendrik Leppkes
On Fri, Jul 19, 2019 at 11:49 PM Nicolas George wrote: > > Michael Niedermayer (12019-07-19): > > > +if ((whence & AVSEEK_SIZE)) > > redundant () > > I use it as a marker that it is not a mistake for &&. IIRC, gcc (with > some options) warns about "if (a & b)" but accepts "if ((a & b))", and >

Re: [FFmpeg-devel] [PATCH 2/3] lavf/aviobuf: make AVSEEK_SIZE usable from outside.

2019-07-19 Thread Nicolas George
Michael Niedermayer (12019-07-19): > > +if ((whence & AVSEEK_SIZE)) > redundant () I use it as a marker that it is not a mistake for &&. IIRC, gcc (with some options) warns about "if (a & b)" but accepts "if ((a & b))", and that is the preferred way. We already have a few instances in the code

Re: [FFmpeg-devel] [PATCH 2/3] lavf/aviobuf: make AVSEEK_SIZE usable from outside.

2019-07-19 Thread Michael Niedermayer
On Fri, Jul 19, 2019 at 02:23:53PM +0200, Nicolas George wrote: > Signed-off-by: Nicolas George > --- > libavformat/aviobuf.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c > index 6a5cd97b0a..750326f62d 100644 > --- a/libavformat/aviobu

[FFmpeg-devel] [PATCH 2/3] lavf/aviobuf: make AVSEEK_SIZE usable from outside.

2019-07-19 Thread Nicolas George
Signed-off-by: Nicolas George --- libavformat/aviobuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 6a5cd97b0a..750326f62d 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -255,6 +255,9 @@ int64_t avio_seek(AVIOContex