border = s->resampler->invert_initial_buffer(s->resample, &s->in_buffer,
&in, in_count, &s->in_buffer_index, &s->in_buffer_count);
- if (border == INT_MAX) return 0;
- else if (border < 0) return border;
- else if (border) { buf_set(&in, &in, border); in_count -= border; s->resample_in_constraint = 0; }
+ if (border == INT_MAX) {
+ return 0;
+ } else if (border < 0) {
+ return border;
+ } else if (border) {
+ buf_set(&in, &in, border);
+ in_count -= border;
+ s->resample_in_constraint = 0;
+ }
do{
int ret, size, consumed;
continue;
}
- if(s->drop_output || !out_arg)
- return 0;
+ av_assert0(s->drop_output);
+ return 0;
}
if(!in_arg){
}
int swr_drop_output(struct SwrContext *s, int count){
+ const uint8_t *tmp_arg[SWR_CH_MAX];
s->drop_output += count;
if(s->drop_output <= 0)
return 0;
av_log(s, AV_LOG_VERBOSE, "discarding %d audio samples\n", count);
- return swr_convert(s, NULL, s->drop_output, NULL, 0);
+ return swr_convert(s, NULL, s->drop_output, tmp_arg, 0);
}
int swr_inject_silence(struct SwrContext *s, int count){