}
}
+#if FF_API_AUDIOENC_DELAY
+ if (av_codec_is_encoder(avctx->codec))
+ avctx->delay = avctx->initial_padding;
+#endif
+
if (av_codec_is_decoder(avctx->codec)) {
/* validate channel layout from the decoder */
if (avctx->channel_layout) {
ret = AVERROR(EINVAL);
goto free_and_end;
}
+
+#if FF_API_AVCTX_TIMEBASE
+ if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
+ avctx->time_base = av_inv_q(avctx->framerate);
+#endif
}
end:
entangled_thread_counter--;
end:
av_frame_free(&padded_frame);
+#if FF_API_AUDIOENC_DELAY
+ avctx->delay = avctx->initial_padding;
+#endif
+
return ret;
}
} else
ret = 0;
+#if FF_API_AVCTX_TIMEBASE
+ if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
+ avctx->time_base = av_inv_q(avctx->framerate);
+#endif
+
return ret;
}
if (profile)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
" (%s)", profile);
+ if (enc->codec_tag) {
+ char tag_buf[32];
+ av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ " [%s / 0x%04X]", tag_buf, enc->codec_tag);
+ }
av_strlcat(buf, "\n ", buf_size);
snprintf(buf + strlen(buf), buf_size - strlen(buf),
"%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
av_get_pix_fmt_name(enc->pix_fmt));
+ if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s",
+ av_color_range_name(enc->color_range));
+ if (enc->colorspace != AVCOL_SPC_UNSPECIFIED ||
+ enc->color_primaries != AVCOL_PRI_UNSPECIFIED ||
+ enc->color_trc != AVCOL_TRC_UNSPECIFIED) {
+ new_line = 1;
+ snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s/%s/%s",
+ av_color_space_name(enc->colorspace),
+ av_color_primaries_name(enc->color_primaries),
+ av_color_transfer_name(enc->color_trc));
+ }
+ if (av_log_get_level() >= AV_LOG_DEBUG &&
+ enc->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s",
+ av_chroma_location_name(enc->chroma_sample_location));
+
if (enc->width) {
av_strlcat(buf, new_line ? "\n " : ", ", buf_size);
"%dx%d",
enc->width, enc->height);
+ if (av_log_get_level() >= AV_LOG_VERBOSE &&
+ (enc->width != enc->coded_width ||
+ enc->height != enc->coded_height))
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ " (%dx%d)", enc->coded_width, enc->coded_height);
+
if (enc->sample_aspect_ratio.num) {
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
enc->width * enc->sample_aspect_ratio.num,
if (profile)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
" (%s)", profile);
+ if (enc->codec_tag) {
+ char tag_buf[32];
+ av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ " [%s / 0x%04X]", tag_buf, enc->codec_tag);
+ }
+
av_strlcat(buf, "\n ", buf_size);
if (enc->sample_rate) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),