Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/AmB2BMedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,11 @@ int AudioStreamData::writeStream(unsigned long long ts, unsigned char *buffer, A
if (stream->sendIntReached(ts)) {
// A leg is ready to send data
int sample_rate = stream->getSampleRate();
// getSampleRate() returns 0 when the stream format is not set yet (or a
// zero-clock-rate codec was negotiated); sample_rate is used as a divisor
// deeper in the AmAudio chain (e.g. AmBufferedAudio::get) and would raise
// SIGFPE. Mirror the guard already applied in AmSession::writeStreams.
if (sample_rate == 0) return 0;
int got = 0;
if (in) got = in->get(ts, buffer, sample_rate, f_size);
else {
Expand Down
Loading