From: Andreas Rheinhardt <andreas.rheinha...@outlook.com> Can be readded if needed (likely never).
Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> --- libavcodec/encode.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 0308c73630..2f789c5b7a 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -814,24 +814,12 @@ int ff_encode_alloc_frame(AVCodecContext *avctx, AVFrame *frame) { int ret; - switch (avctx->codec->type) { - case AVMEDIA_TYPE_VIDEO: - frame->format = avctx->pix_fmt; - if (frame->width <= 0 || frame->height <= 0) { - frame->width = avctx->width; - frame->height = avctx->height; - } + av_assert1(avctx->codec_type == AVMEDIA_TYPE_VIDEO); - break; - case AVMEDIA_TYPE_AUDIO: - frame->sample_rate = avctx->sample_rate; - frame->format = avctx->sample_fmt; - if (!frame->ch_layout.nb_channels) { - ret = av_channel_layout_copy(&frame->ch_layout, &avctx->ch_layout); - if (ret < 0) - return ret; - } - break; + frame->format = avctx->pix_fmt; + if (frame->width <= 0 || frame->height <= 0) { + frame->width = avctx->width; + frame->height = avctx->height; } ret = avcodec_default_get_buffer2(avctx, frame, 0); -- ffmpeg-codebot _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".