mirror of
https://github.com/openharmony/third_party_ffmpeg.git
synced 2026-08-24 13:03:14 -04:00
@@ -230,6 +230,14 @@ int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len
|
||||
ctx->simd_f(out->ch+ch, (const uint8_t **)in->ch+ch, off * (out->planar ? 1 :out->ch_count));
|
||||
}
|
||||
}else{
|
||||
#ifdef OHOS_OPT_COMPAT
|
||||
for (int ch_i = 0; ch_i < ctx->channels; ch_i++) {
|
||||
if (!in->ch[ch_i]) {
|
||||
av_log(NULL, AV_LOG_ERROR, "in->ch[%d] is NULL\n", ch_i);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ctx->simd_f(out->ch, (const uint8_t **)in->ch, off);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,7 +687,15 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
|
||||
|
||||
if(s->full_convert){
|
||||
av_assert0(!s->resample);
|
||||
#ifdef OHOS_OPT_COMPAT
|
||||
ret = swri_audio_convert(s->full_convert, out, in, in_count);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "full_convert swri_audio_convert failed\n");
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
swri_audio_convert(s->full_convert, out, in, in_count);
|
||||
#endif
|
||||
return out_count;
|
||||
}
|
||||
|
||||
@@ -738,7 +746,15 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
|
||||
}
|
||||
|
||||
if(in != postin){
|
||||
#ifdef OHOS_OPT_COMPAT
|
||||
ret = swri_audio_convert(s->in_convert, postin, in, in_count);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "swri_audio_convert failed\n");
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
swri_audio_convert(s->in_convert, postin, in, in_count);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(s->resample_first){
|
||||
@@ -804,7 +820,15 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
|
||||
s->dither.noise_pos += out_count;
|
||||
}
|
||||
//FIXME packed doesn't need more than 1 chan here!
|
||||
#ifdef OHOS_OPT_COMPAT
|
||||
ret = swri_audio_convert(s->out_convert, out, conv_src, out_count);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "swri_audio_convert failed\n");
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
swri_audio_convert(s->out_convert, out, conv_src, out_count);
|
||||
#endif
|
||||
}
|
||||
return out_count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user