[x264-devel] Yet another updated threaded slicetype patch (v14)

Jason Garrett-Glaser darkshikari at gmail.com
Wed Jul 1 17:52:31 CEST 2009


On Wed, Jul 1, 2009 at 8:49 AM, Guillaume POIRIER<poirierg at gmail.com> wrote:
> Hello,
>
> On Wed, Jul 1, 2009 at 4:56 PM, Mike Kazmier <DaKaZ at zenbe.com> wrote:
>>
>> On Fri, Jun 5, 2009 at 10:17 PM "Steven Walters" <kemuri9 at gmail.com>
>> wrote:
>> >yeah it's no problem to help out, would like to see the patch get
>> > finalized and put to use for everyone...
>>
>> All - with a big HOORAY to Steven for his effort in fixing the v14 patch
>> for proper functionality - we are proud to submit this patch which has been
>> tested on linux and windows and appears to be functioning properly.  We
>> would love to get this committed.
>>
>> Thanks
>
> I had a quick look at it, and these lines hurt my eyes:
>
> +#ifndef USE_USLEEP
> +            x264_pthread_cond_wait( &h->lookahead->ofbuf.cv_empty,
> &h->lookahead->ofbuf.mutex );
>
> +#else
> +            x264_pthread_mutex_unlock( &h->lookahead->ofbuf.mutex );
> +            usleep( 100 );
> +            x264_pthread_mutex_lock( &h->lookahead->ofbuf.mutex );
> +#endif
>
>
> You shouldn't duplicate these lines over and over again. You can probably
> fix that problem by putting these changes directly in x264_pthread_cond_wait
> (but I'm not certain).

And furthermore, if we don't know why usleep is faster, we can't
commit anything using it, because we don't subscribe to cargo cult
programming.

Dark Shikari


More information about the x264-devel mailing list