Lines Matching refs:ret

90     int ret;
100 if ((ret = av_opt_set_chlayout(s, "ochl", out_ch_layout, 0)) < 0)
103 if ((ret = av_opt_set_int(s, "osf", out_sample_fmt, 0)) < 0)
106 if ((ret = av_opt_set_int(s, "osr", out_sample_rate, 0)) < 0)
109 if ((ret = av_opt_set_chlayout(s, "ichl", in_ch_layout, 0)) < 0)
112 if ((ret = av_opt_set_int(s, "isf", in_sample_fmt, 0)) < 0)
115 if ((ret = av_opt_set_int(s, "isr", in_sample_rate, 0)) < 0)
132 return ret;
192 int ret;
251 if (!(ret = av_channel_layout_check(&s->in_ch_layout)) || s->in_ch_layout.nb_channels > SWR_CH_MAX) {
252 if (ret)
254 av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", ret ? l1 : "");
258 if (!(ret = av_channel_layout_check(&s->out_ch_layout)) || s->out_ch_layout.nb_channels > SWR_CH_MAX) {
259 if (ret)
261 av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", ret ? l2 : "");
268 if (!(ret = av_channel_layout_check(&s->user_in_chlayout)) || s->user_in_chlayout.nb_channels > SWR_CH_MAX) {
269 if (ret)
271 av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", ret ? l1 : "");
275 if (!(ret = av_channel_layout_check(&s->user_out_chlayout)) || s->user_out_chlayout.nb_channels > SWR_CH_MAX) {
276 if (ret)
278 av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", ret ? l2 : "");
282 ret = av_channel_layout_copy(&s->in_ch_layout, &s->user_in_chlayout);
283 ret |= av_channel_layout_copy(&s->out_ch_layout, &s->user_out_chlayout);
284 if (ret < 0)
285 return ret;
385 ret = AVERROR(EINVAL);
400 ret = AVERROR(EINVAL);
408 ret = AVERROR(EINVAL);
415 ret = AVERROR(EINVAL);
423 ret = AVERROR(EINVAL);
435 if ((ret = swri_dither_init(s, s->out_sample_fmt, s->int_sample_fmt)) < 0)
450 ret = AVERROR(ENOMEM);
488 ret = swri_rematrix_init(s);
489 if (ret < 0)
496 return ret;
614 int ret, size, consumed;
617 ret= s->resampler->multiple_resample(s->resample, &out, out_count, &tmp, s->in_buffer_count, &consumed);
618 out_count -= ret;
619 ret_sum += ret;
620 buf_set(&out, &out, ret);
637 ret= s->resampler->multiple_resample(s->resample, &out, out_count, &in, FFMAX(in_count-padless, 0), &consumed);
638 out_count -= ret;
639 ret_sum += ret;
640 buf_set(&out, &out, ret);
653 if((ret=swri_realloc_audio(&s->in_buffer, size)) < 0)
654 return ret;
685 int ret/*, in_max*/;
697 if((ret=swri_realloc_audio(&s->postin, in_count))<0)
698 return ret;
701 if((ret=swri_realloc_audio(&s->midbuf, out_count))<0)
702 return ret;
705 if((ret=swri_realloc_audio(&s->midbuf, in_count))<0)
706 return ret;
708 if((ret=swri_realloc_audio(&s->preout, out_count))<0)
709 return ret;
766 if((ret=swri_realloc_audio(&s->dither.temp, dither_count))<0)
767 return ret;
770 if((ret=swri_realloc_audio(&s->dither.noise, dither_count))<0)
771 return ret;
772 if(ret)
774 if((ret=swri_get_dither(s, s->dither.noise.ch[ch], s->dither.noise.count, (12345678913579ULL*ch + 3141592) % 2718281828U, s->dither.noise.fmt))<0)
775 return ret;
833 int ret;
836 if((ret=swri_realloc_audio(&s->drop_temp, FFMIN(s->drop_output, MAX_DROP_STEP)))<0)
837 return ret;
841 ret = swr_convert(s, tmp_arg, FFMIN(-s->drop_output, MAX_DROP_STEP), in_arg, in_count); //FIXME optimize but this is as good as never called so maybe it doesn't matter
844 if(ret>0) {
845 s->drop_output -= ret;
870 int ret = swr_convert_internal(s, out, out_count, in, in_count);
871 if(ret>0 && !s->drop_output)
872 s->outpts += ret * (int64_t)s->in_sample_rate;
874 av_assert2(max_output < 0 || ret <= max_output);
876 return ret;
880 int ret, size;
884 ret= swr_convert_internal(s, out, size, &tmp, size);
885 if(ret<0)
886 return ret;
887 ret2= ret;
888 s->in_buffer_count -= ret;
889 s->in_buffer_index += ret;
890 buf_set(out, out, ret);
891 out_count -= ret;
906 if((ret=swri_realloc_audio(&s->in_buffer, size)) < 0)
907 return ret;
912 ret= swr_convert_internal(s, out, size, in, size);
913 if(ret<0)
914 return ret;
915 buf_set(in, in, ret);
916 in_count -= ret;
917 ret2 += ret;
944 int ret, i;
952 if ((ret = swr_inject_silence(s, MAX_SILENCE_STEP)) < 0)
953 return ret;
957 if((ret=swri_realloc_audio(&s->silence, count))<0)
958 return ret;
967 ret = swr_convert(s, NULL, 0, (const uint8_t**)tmp_arg, count);
968 return ret;
1002 int ret;
1010 ret = swr_init(s);
1011 if (ret < 0)
1012 return ret;
1036 int ret;
1037 if(delta > 0) ret = swr_inject_silence(s, delta / s->out_sample_rate);
1038 else ret = swr_drop_output (s, -delta / s-> in_sample_rate);
1039 if(ret<0){