Showing the changes to libswresample (2 of 2 files). Show all
Unified · Split
| @@ -369,7 +369,7 @@ av_assert0(s->out.ch_count); · 368 unmodified lines | ||
| 369 | 369 | return 0; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | −static int realloc_audio(AudioData *a, int count){ | |
| 372 | +int swri_realloc_audio(AudioData *a, int count){ | |
| 373 | 373 | int i, countb; |
| 374 | 374 | AudioData old; |
| 375 | 375 | |
| @@ -509,7 +509,7 @@ static int resample(SwrContext *s, AudioData *out_param, int out_count, · 133 unmodified lines | ||
| 509 | 509 | copy(&s->in_buffer, &tmp, s->in_buffer_count); |
| 510 | 510 | s->in_buffer_index=0; |
| 511 | 511 | }else |
| 512 | − if((ret=realloc_audio(&s->in_buffer, size)) < 0) | |
| 512 | + if((ret=swri_realloc_audio(&s->in_buffer, size)) < 0) | |
| 513 | 513 | return ret; |
| 514 | 514 | |
| 515 | 515 | if(in_count){ |
| @@ -549,18 +549,18 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co · 33 unmodified lines | ||
| 549 | 549 | // in_max= out_count*(int64_t)s->in_sample_rate / s->out_sample_rate + resample_filter_taps; |
| 550 | 550 | // in_count= FFMIN(in_count, in_in + 2 - s->hist_buffer_count); |
| 551 | 551 | |
| 552 | − if((ret=realloc_audio(&s->postin, in_count))<0) | |
| 552 | + if((ret=swri_realloc_audio(&s->postin, in_count))<0) | |
| 553 | 553 | return ret; |
| 554 | 554 | if(s->resample_first){ |
| 555 | 555 | av_assert0(s->midbuf.ch_count == s->used_ch_count); |
| 556 | − if((ret=realloc_audio(&s->midbuf, out_count))<0) | |
| 556 | + if((ret=swri_realloc_audio(&s->midbuf, out_count))<0) | |
| 557 | 557 | return ret; |
| 558 | 558 | }else{ |
| 559 | 559 | av_assert0(s->midbuf.ch_count == s->out.ch_count); |
| 560 | − if((ret=realloc_audio(&s->midbuf, in_count))<0) | |
| 560 | + if((ret=swri_realloc_audio(&s->midbuf, in_count))<0) | |
| 561 | 561 | return ret; |
| 562 | 562 | } |
| 563 | − if((ret=realloc_audio(&s->preout, out_count))<0) | |
| 563 | + if((ret=swri_realloc_audio(&s->preout, out_count))<0) | |
| 564 | 564 | return ret; |
| 565 | 565 | |
| 566 | 566 | postin= &s->postin; |
| @@ -613,7 +613,7 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co · 46 unmodified lines | ||
| 613 | 613 | int dither_count= FFMAX(out_count, 1<<16); |
| 614 | 614 | av_assert0(preout != in); |
| 615 | 615 | |
| 616 | − if((ret=realloc_audio(&s->dither, dither_count))<0) | |
| 616 | + if((ret=swri_realloc_audio(&s->dither, dither_count))<0) | |
| 617 | 617 | return ret; |
| 618 | 618 | if(ret) |
| 619 | 619 | for(ch=0; ch<s->dither.ch_count; ch++) |
| @@ -645,7 +645,7 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun · 25 unmodified lines | ||
| 645 | 645 | uint8_t *tmp_arg[SWR_CH_MAX]; |
| 646 | 646 | tmp.count = 0; |
| 647 | 647 | tmp.data = NULL; |
| 648 | − if((ret=realloc_audio(&tmp, s->drop_output))<0) | |
| 648 | + if((ret=swri_realloc_audio(&tmp, s->drop_output))<0) | |
| 649 | 649 | return ret; |
| 650 | 650 | |
| 651 | 651 | reversefill_audiodata(&tmp, tmp_arg); |
| @@ -666,7 +666,7 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun · 14 unmodified lines | ||
| 666 | 666 | if (s->resample && !s->flushed) { |
| 667 | 667 | AudioData *a= &s->in_buffer; |
| 668 | 668 | int i, j, ret; |
| 669 | − if((ret=realloc_audio(a, s->in_buffer_index + 2*s->in_buffer_count)) < 0) | |
| 669 | + if((ret=swri_realloc_audio(a, s->in_buffer_index + 2*s->in_buffer_count)) < 0) | |
| 670 | 670 | return ret; |
| 671 | 671 | av_assert0(a->planar); |
| 672 | 672 | for(i=0; i<a->ch_count; i++){ |
| @@ -721,7 +721,7 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun · 48 unmodified lines | ||
| 721 | 721 | copy(&s->in_buffer, &tmp, s->in_buffer_count); |
| 722 | 722 | s->in_buffer_index=0; |
| 723 | 723 | }else |
| 724 | − if((ret=realloc_audio(&s->in_buffer, size)) < 0) | |
| 724 | + if((ret=swri_realloc_audio(&s->in_buffer, size)) < 0) | |
| 725 | 725 | return ret; |
| 726 | 726 | } |
| 727 | 727 | |
| @@ -766,7 +766,7 @@ int swr_inject_silence(struct SwrContext *s, int count){ · 38 unmodified lines | ||
| 766 | 766 | |
| 767 | 767 | silence.count = 0; |
| 768 | 768 | silence.data = NULL; |
| 769 | − if((ret=realloc_audio(&silence, count))<0) | |
| 769 | + if((ret=swri_realloc_audio(&silence, count))<0) | |
| 770 | 770 | return ret; |
| 771 | 771 | |
| 772 | 772 | if(silence.planar) for(i=0; i<silence.ch_count; i++) { |
| @@ -141,6 +141,7 @@ struct Resampler { · 140 unmodified lines | ||
| 141 | 141 | |
| 142 | 142 | extern struct Resampler const swri_resampler; |
| 143 | 143 | |
| 144 | +int swri_realloc_audio(AudioData *a, int count); | |
| 144 | 145 | int swri_resample_int16(struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx); |
| 145 | 146 | int swri_resample_int32(struct ResampleContext *c, int32_t *dst, const int32_t *src, int *consumed, int src_size, int dst_size, int update_ctx); |
| 146 | 147 | int swri_resample_float(struct ResampleContext *c, float *dst, const float *src, int *consumed, int src_size, int dst_size, int update_ctx); |