Browse Source

disallow arbitrarily large silence gaps

Change-Id: I9c62fc99d237ccf998b5eedfa3f1a38c2430a323
changes/55/12455/1
Richard Fuchs 9 years ago
parent
commit
a8a4ed4f9d
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      recording-daemon/mix.c

+ 6
- 0
recording-daemon/mix.c View File

@ -170,6 +170,12 @@ static void mix_silence_fill_idx_upto(mix_t *mix, unsigned int idx, uint64_t upt
unsigned int silence_samples = mix->format.clockrate / 100;
while (mix->in_pts[idx] < upto) {
if (G_UNLIKELY(upto - mix->in_pts[idx] > mix->format.clockrate * 30)) {
ilog(LOG_WARN, "More than 30 seconds of silence needed to fill mix buffer, resetting");
mix->in_pts[idx] = upto;
break;
}
if (G_UNLIKELY(!mix->silence_frame)) {
mix->silence_frame = av_frame_alloc();
mix->silence_frame->format = mix->format.format;


Loading…
Cancel
Save