Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-20 Thread Michael Niedermayer
On Sun, Nov 19, 2017 at 03:23:47PM -0800, Nick Lewycky wrote: > Sorry-- what should I do now? Wait for another patch to go in first then > rebase on top of it? Attempt to migrate error_count to C11 atomics myself? > If I'm migrating, is there a primer on how ffmpeg uses C11 atomics? For >

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-20 Thread Michael Niedermayer
On Sun, Nov 19, 2017 at 03:23:47PM -0800, Nick Lewycky wrote: [...] > error_resilience.c | 22 -- > error_resilience.h |3 ++- > h264_slice.c |6 -- > mpeg12dec.c| 11 ++- > mpegvideo_enc.c|5 - > 5 files changed, 28

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-19 Thread Nick Lewycky
Sorry-- what should I do now? Wait for another patch to go in first then rebase on top of it? Attempt to migrate error_count to C11 atomics myself? If I'm migrating, is there a primer on how ffmpeg uses C11 atomics? For instance, given an atomic_int, should I assign to it with equality,

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-17 Thread Michael Niedermayer
On Fri, Nov 17, 2017 at 05:10:17PM -0300, James Almer wrote: > On 11/17/2017 4:20 PM, James Almer wrote: > > On 11/17/2017 4:16 PM, Michael Niedermayer wrote: > >> On Thu, Nov 16, 2017 at 03:07:54PM -0800, Nick Lewycky wrote: > >>> Sorry! Let's try an attachment then. > >>> > >>> On 16 November

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-17 Thread James Almer
On 11/17/2017 4:20 PM, James Almer wrote: > On 11/17/2017 4:16 PM, Michael Niedermayer wrote: >> On Thu, Nov 16, 2017 at 03:07:54PM -0800, Nick Lewycky wrote: >>> Sorry! Let's try an attachment then. >>> >>> On 16 November 2017 at 14:36, Michael Niedermayer >>> wrote:

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-17 Thread James Almer
On 11/17/2017 4:16 PM, Michael Niedermayer wrote: > On Thu, Nov 16, 2017 at 03:07:54PM -0800, Nick Lewycky wrote: >> Sorry! Let's try an attachment then. >> >> On 16 November 2017 at 14:36, Michael Niedermayer >> wrote: >>> On Thu, Nov 16, 2017 at 12:41:32PM -0800, Nick

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-17 Thread Michael Niedermayer
On Thu, Nov 16, 2017 at 03:07:54PM -0800, Nick Lewycky wrote: > Sorry! Let's try an attachment then. > > On 16 November 2017 at 14:36, Michael Niedermayer > wrote: > > On Thu, Nov 16, 2017 at 12:41:32PM -0800, Nick Lewycky wrote: > >> I initially discovered a signed

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-16 Thread Nick Lewycky
Sorry! Let's try an attachment then. On 16 November 2017 at 14:36, Michael Niedermayer wrote: > On Thu, Nov 16, 2017 at 12:41:32PM -0800, Nick Lewycky wrote: >> I initially discovered a signed integer overflow on this line. Since >> this value is updated in multiple

Re: [FFmpeg-devel] [PATCH] libavcodec/mpeg12dec: Use atomic addition for value updated in multiple threads.

2017-11-16 Thread Michael Niedermayer
On Thu, Nov 16, 2017 at 12:41:32PM -0800, Nick Lewycky wrote: > I initially discovered a signed integer overflow on this line. Since > this value is updated in multiple threads, I use an atomic update and > as it happens atomic addition is defined to wrap around. However, > there's still a