Skip to content

Commit

Permalink
Report when realtime underflow happens.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Oct 15, 2023
1 parent 24af46e commit d641063
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions video/ffmpeg_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ size_t AVFrameRingStream::accumulate_samples(float *const *channels, const float
memset(tmp_resampler_ptrs[i], 0, required * sizeof(float));
}
size_t accum = accumulate_samples_inner(tmp_resampler_ptrs, gain, required);

if (accum < required)
LOGW("Underflow in audio thread (%zu < %zu).\n", accum, required);

for (unsigned i = 0; i < num_channels; i++)
{
resamplers[i]->set_sample_rate_ratio(ratio);
Expand Down

0 comments on commit d641063

Please sign in to comment.