Re: [FFmpeg-devel] [PATCH] avformat/mp3dec: Fix definition of MIDDLE_BITS

2017-10-03 Thread Michael Niedermayer
On Tue, Oct 03, 2017 at 03:50:37PM +0200, Ingo Brückl wrote:
> The number of bits from bit #m to #n is n - m plus 1.
> 
> Signed-off-by: Ingo Brückl 
> ---
>  libavformat/mp3dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patch

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/mp3dec: Fix definition of MIDDLE_BITS

2017-10-03 Thread Carl Eugen Hoyos
2017-10-03 15:50 GMT+02:00 Ingo Brückl :
> The number of bits from bit #m to #n is n - m plus 1.

> -#define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m)))
> +#define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m) + 1))

I cannot comment on this patch but if this fixes a sample
of yours, please add a fate test.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/mp3dec: Fix definition of MIDDLE_BITS

2017-10-03 Thread Ingo Brückl
The number of bits from bit #m to #n is n - m plus 1.

Signed-off-by: Ingo Brückl 
---
 libavformat/mp3dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 0924a57843..a5c4f2ea12 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -142,7 +142,7 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream 
*st,
MPADecodeHeader *c, uint32_t spf)
 {
 #define LAST_BITS(k, n) ((k) & ((1 << (n)) - 1))
-#define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m)))
+#define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m) + 1))

 uint16_t crc;
 uint32_t v;
--
2.14.2
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel