X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibswresample%2Fswresample.c;h=b0bd697e04ab50ce5dd1d71feae4a24b62fca824;hp=c325513efab5ecdbedb49b1bd6c3076bf267804b;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libswresample/swresample.c b/ffmpeg/libswresample/swresample.c index c325513..b0bd697 100644 --- a/ffmpeg/libswresample/swresample.c +++ b/ffmpeg/libswresample/swresample.c @@ -435,9 +435,15 @@ static int resample(SwrContext *s, AudioData *out_param, int out_count, 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; @@ -668,8 +674,8 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun continue; } - if(s->drop_output || !out_arg) - return 0; + av_assert0(s->drop_output); + return 0; } if(!in_arg){ @@ -746,13 +752,14 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun } 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){