[FFmpeg-devel] h264 threading fate tests

Michael Niedermayer michaelni at gmx.at
Thu Jul 19 16:47:23 CEST 2012


On Wed, Jul 11, 2012 at 05:48:50PM +0200, Clément Bœsch wrote:
> On Mon, Apr 16, 2012 at 04:43:42PM +0200, Clément Bœsch wrote:
> > Hi,
> > 
> > I recently setup a few fate instances to test the threading (2, 8, 16 and
> > auto), and regularly one of the h264 conformance test fails; look at the
> > yellow entries here for instance:
> > http://fate.ffmpeg.org/history.cgi?slot=x86_64-archlinux-gcc-threads-8
> > 
> > The other day, I tried to run an automated git bisect run, but
> > unfortunately testing the potential regression would requires to run
> > something like "while true; do make fate-h264 -j20 THREADS=8; done" for
> > around 15 minutes at least each time, and it might not even be reliable.
> > 
> > I'm not familiar at all with AVC decoding or threading in FFmpeg, but
> > maybe someone has an idea of what could cause this?
> > 
> 
> I added a helgrind box on FATE and it seems to detect a few races:
> http://fate.ffmpeg.org/report.cgi?time=20120711153812&slot=x86_64-archlinux-gcc-valgrind-threads
> 
> If anyone is up to fix the more obvious ones...
>

> Some of them look simple to fix at first sight, for instance:
> 
> diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
> index 7f2ea09..597aeba 100644
> --- a/libavcodec/pthread.c
> +++ b/libavcodec/pthread.c
> @@ -975,9 +975,9 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
>          avctx->get_buffer == avcodec_default_get_buffer) {
>          err = avctx->get_buffer(avctx, f);
>      } else {
> +        pthread_mutex_lock(&p->progress_mutex);
>          p->requested_frame = f;
>          p->state = STATE_GET_BUFFER;
> -        pthread_mutex_lock(&p->progress_mutex);
>          pthread_cond_broadcast(&p->progress_cond);
>  
>          while (p->state != STATE_SETTING_UP)

LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120719/78aee11e/attachment.asc>


More information about the ffmpeg-devel mailing list