[FFmpeg-devel] [PATCH] libavdevice: JACK demuxer

Måns Rullgård mans
Fri Feb 27 21:00:12 CET 2009

Olivier Guilyardi <list at samalyse.com> writes:

> M?ns Rullg?rd wrote:
>> Olivier Guilyardi <list at samalyse.com> writes:
>>> Reimar D?ffinger wrote:
>>>> On Fri, Feb 27, 2009 at 06:58:55PM +0100, Olivier Guilyardi wrote:
>>>>> +jack_demuxer_extralibs="-ljack -lpthread -lrt"
>>>> just -ljack works just fine for MPlayer...
>>> Okay, corrected.
>>>>> +#define _BSD_SOURCE 1
>>>> what exactly is that one needed for?
>>> It's for usleep() from unistd.h. For some reason, it doesn't work if
>>> I add it right above #include <unistd.h>
>> What do you need usleep() for?  Sleeping in an input handler smells of
>> bad design.
> The jack process callback, which runs in the JACK realtime thread,
> reads audio from JACK. It then places this data into a ringbuffer,
> for the audio_read_packet() callback to fetch it, and return it in a
> AVPacket. It the ringbuffer is empty at this point,
> audio_read_packet() sleeps a period, tries again, etc.... It times
> out after 2 seconds.

As I said, bad design.  The proper solution is to use a condition

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list