[FFmpeg-devel] [PATCH] ffmpeg: make reading packets from thread blocking.

Nicolas George george at nsup.org
Wed Feb 19 16:48:14 CET 2014


Le nonidi 9 brumaire, an CCXXII, Michael Niedermayer a écrit :
> sadly not but i could reproduce it here again stuck in
> fate-filter-amix-transition
> but even running that 100 times shows no deadlock, seems it happens
> only in a full fate run for me
> 
> also from looking at the code i see that finished could get set
> while the other thread is waiting, i didnt check if that would deadlock
> though

I believe that was the problem: I could produce a hang like the one
described in this thread by adding a sleep() just before f->finished was
set.

Thanks for the testing and the analysis.

> also iam not sure that fifo_cond should be reused

I am convinced this use is correct: fifo_cond covers any change to fifo_size
and finished.

Here is an updated version of the patch. I ran FATE a couple of times, with
various number of parallel processes and with and without the usleep(), and
it did not hang.

I suspect lavu could offer this kind of synchronized message passing queue,
though, and it could be a bit cleaner, especially for error passing. Shall I
propose something for that?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffmpeg-make-reading-packets-from-thread-blocking.patch
Type: text/x-diff
Size: 2942 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140219/091ad4bf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140219/091ad4bf/attachment.asc>


More information about the ffmpeg-devel mailing list