Commit dbd7a84c authored by Burt P's avatar Burt P

af_hdcd: Don't warn if converting from AV_SAMPLE_FMT_S16P

Also checking AVFilterLink->type is AVMEDIA_TYPE_AUDIO before
calling av_get_sample_fmt_name() on AVFilterLink->format.
Signed-off-by: 's avatarBurt P <pburt0@gmail.com>
parent b2b659b1
...@@ -1714,13 +1714,17 @@ static int config_input(AVFilterLink *inlink) { ...@@ -1714,13 +1714,17 @@ static int config_input(AVFilterLink *inlink) {
AVFilterLink *lk = inlink; AVFilterLink *lk = inlink;
while(lk != NULL) { while(lk != NULL) {
AVFilterContext *nextf = lk->src; AVFilterContext *nextf = lk->src;
if (lk->format != AV_SAMPLE_FMT_S16 || lk->sample_rate != 44100) { if (lk->type == AVMEDIA_TYPE_AUDIO) {
av_log(ctx, AV_LOG_WARNING, "An input format is %s@%dHz at %s. It will truncated/resampled to s16@44100Hz.\n", int sfok = (lk->format == AV_SAMPLE_FMT_S16 ||
av_get_sample_fmt_name(lk->format), lk->sample_rate, lk->format == AV_SAMPLE_FMT_S16P);
(nextf->name) ? nextf->name : "<unknown>" if ( !sfok || lk->sample_rate != 44100) {
); av_log(ctx, AV_LOG_WARNING, "An input format is %s@%dHz at %s. It will truncated/resampled to s16@44100Hz.\n",
s->bad_config = 1; av_get_sample_fmt_name(lk->format), lk->sample_rate,
break; (nextf->name) ? nextf->name : "<unknown>"
);
s->bad_config = 1;
break;
}
} }
lk = (nextf->inputs) ? nextf->inputs[0] : NULL; lk = (nextf->inputs) ? nextf->inputs[0] : NULL;
} }
...@@ -1746,13 +1750,15 @@ static int config_output(AVFilterLink *outlink) { ...@@ -1746,13 +1750,15 @@ static int config_output(AVFilterLink *outlink) {
AVFilterLink *lk = outlink; AVFilterLink *lk = outlink;
while(lk != NULL) { while(lk != NULL) {
AVFilterContext *nextf = lk->dst; AVFilterContext *nextf = lk->dst;
if (lk->format == AV_SAMPLE_FMT_S16 || lk->format == AV_SAMPLE_FMT_U8) { if (lk->type == AVMEDIA_TYPE_AUDIO) {
av_log(ctx, AV_LOG_WARNING, "s24 output is being truncated to %s at %s. (Try -f s24le after the filter)\n", if (lk->format == AV_SAMPLE_FMT_S16 || lk->format == AV_SAMPLE_FMT_U8) {
av_get_sample_fmt_name(lk->format), av_log(ctx, AV_LOG_WARNING, "s24 output is being truncated to %s at %s.\n",
(nextf->name) ? nextf->name : "<unknown>" av_get_sample_fmt_name(lk->format),
); (nextf->name) ? nextf->name : "<unknown>"
s->bad_config = 1; );
break; s->bad_config = 1;
break;
}
} }
lk = (nextf->outputs) ? nextf->outputs[0] : NULL; lk = (nextf->outputs) ? nextf->outputs[0] : NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment