Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Reduces default fragment size from the pulse audio default of 2 sec to 50 ms.
This also has an effect on the size of the returned frames, which will be
around 50 ms as well, making timestamps more accurate.
This should fix the regression in ticket #9776.
Pulseaudio timestamps for monitor sources are still pretty inaccurate for me,
but I don't see how else should we query latencies from the library.
Signed-off-by: Marton Balint <cus@passwd.hu>
This reverts commit 7f059a250b.
Apparently adjusting latency makes a difference even if fragment size is specifed.
Signed-off-by: Marton Balint <cus@passwd.hu>
This is possible now that the next-API is gone.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Keep on reading fragments until we got fragment_size amount of data, otherwise
we might get frames with 1-2 samples only if pa_stream_peek is called slightly
less frequently than sample rate.
Note that fragments might contain a lot less data than fragment_size, so
reading multiple fragments to get fragment_size amount of data is intentional.
Signed-off-by: Marton Balint <cus@passwd.hu>
PulseAudio expilitly requires name of the source.
This patch makes it use default source when not provided.
It simplifies programistic use.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This fixes timestamps
Based-on: code from pulseaudio
Reviewed-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The stream time_base has been changed to be a multiple of the
device sample_rate. Now the frame_duration computation is simpler
and a message will warn about problematic frame_size values.
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Add ff_ prefix for internal API function.
Change type of param from int into enum AVCodecID as it is more specific.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
In particular, fix punctuation in docs and make option help messages
grammatically consistent.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
This make name of the file more specific
as there is also encoder implementation.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The frame duration was calculated without taking in account the
bytes per sample.
Thanks to Lorenzo Pistone <blaffablaffa@gmail.com> for pointing
the issue and providing an initial fix.
It currently use the simple api and is using the latency information
provided only to offset the stream start.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>