This fixes the rare case of resume_time being bigger than time_stamp. Which
happens sometimes when a gstreamer client is quickly seeking through a
media file. The resulting integer underflow then causes a huge value in
current_time which will break the playback.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/764>
When `pwd.h` header is not available (i.e. not using glibc) and environment
variables are not set (e.g. running via `env --ignore-environment`) client
library would crash due to uninitialized variable in `pa_get_home_dir()`.
Add missing initialization to fix that.
Fixes: #3792
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/800>
RFC 4566 states that SDP record is terminated with CRLF, and parsers should be
able to accept records terminated with just LF. Pulseaudio only accepts LF here.
Fix this by accepting both CRLF and LF terminators.
When a stream is started but has not yet called smoother_2_put(), pa_smoother_2_get()
returns the time since the start of the stream even if the stream was started paused.
When the stream is started paused, pa_smoother_2_get() should return 0 instead. This
patch fixes the problem.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/745>
GST_TYPE_BITMASK is 64-bit bit mask while corresponding channel_mask in
pulseaudio is int therefore usually 32-bit. Switch to uint64_t instead
to match internal representation in gstreamer.
Fixes pulseaudio crash on ARM 32-bit when pulseaudio is compiled with
gstreamer and either LDAC or aptX support is available.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/723>
A recent commit added i->origin sink for the sink inputs of the combine sinks.
Therefore pa_sink_process_input_underruns() treated the combine sink like
filter sinks. pa_sink_process_input_underruns() calls itself with the
origin sink, which is only correct for filter sinks because they run in the
thread context of the origin sink. The combine sink however has its own
thread context, so pa_sink_process_input_underruns() was executed in the
wrong context.
This patch fixes the issue by skipping the section for module-combine-sink.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/722>
Turned out that pa_sdp_info::enable_opus is never initialized, which seldom
makes module-rtp-recv believe it will be playing OPUS-encoded stream even though
discovered SDP record does not indicate OPUS codec in metadata.
Fix this by adding missing initializer.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/720>
pulseaudio crash occurred when I play a file using pacmd play-file command.
The file is not aligned with its frame size and the last rendering size
is also not aligned. Thus, an assertion was generated at the end of the
file as the following.
memblockq.c: Assertion 'uchunk->length % bq->base == 0' failed at
../src/pulsecore/memblockq.c:288, function pa_memblockq_push(). Aborting.
When I play the file using paplay, it works good. So, I changed to
pa_memblockq_push_align instead of pa_memblockq_push to prevent the
assertion.
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/717>
The logic for detecting which type of volume was given incorrectly interpreted
any value with a decimal as a VOL_LINEAR. It also could set multiple flags,
which would put the flags variable into an indeterminate state. Additionally,
the flags stack variable was uninitialized which could also lead to an
indeterminate flag state.
Percentages are now prioritized over all other types, and only one type flag
can be set.
The combine sink used the current time and counter when calculating
the latency if smoother_2 was enabled. This lead to wrong latency
reports. This patch fixes the problem by using the snapshot time
and counter instead.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/711>
Bluetooth transport layer already allows for packets larger than mSBC frame, and
there are up to 1 + MTU / (mSBC packet size) complete frames to be decoded from
each incoming SCO packet.
Now decoder fails when there is more than one complete frame available, which
could happen if MTU size is larger than 1.5 * (mSBC packet size) = 90
Fix this by adding a loop over avialable frames, and adjust decoded buffer size
to allow decoding up to 1 + MTU / (mSBC packet size) frames at once.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/706>
When the module is loaded and avahi_client_new() fails because the client cannot
connect, a shutdown of the module is scheduled. In parallel, the client_callback
is called with AVAHI_ERR_DISCONNECTED and another connection attempt is made
which also fails and triggers a second unload of the module. This crashes PA,
because there is already an unload in progress.
This patch fixes the problem by checking if an unload is already scheduled.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/710>
The timestamp used for updating the smoother was taken at the wrong time.
It may take some time until an async message is executed (measured up to
2ms), therefore the timestamp used to update the smoother must be taken
before the message is executed and not inside the message.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/705>
When the tunnel modules had no connection and a re-init was pending, the module
could be unloaded without cancelling the pending re-init. When the timer expired
in that situation, this lead to a crash. This patch fixes the problem by keeping
a reference when the module is scheduled to be re-initialized.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/705>
The AVRCP service is known to not be connected before the A2DP transport
is, resulting in PulseAudio asking BlueZ for an initial 'Volume' value
but not getting it because the property doesn't exist.
To prevent end-users from conjecturing this to be the source of whatever
issue they're observing, demote it to a warning.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/707>