avviddec: Take into account coded_height for pool

Failure to do this would cause the decoders to constantly request a new
bufferpool thinking the height had changed ... whereas it hadn't.

Fixes #95

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/131>
This commit is contained in:
Edward Hervey 2021-04-24 10:04:23 +02:00 committed by Edward Hervey
parent 672f1caf85
commit 75fb364bf4

View file

@ -790,7 +790,8 @@ gst_ffmpegviddec_ensure_internal_pool (GstFFMpegVidDec * ffmpegdec,
/* Remember pool size so we can detect changes */
ffmpegdec->pool_width = picture->width;
ffmpegdec->pool_height = picture->height;
ffmpegdec->pool_height =
MAX (picture->height, ffmpegdec->context->coded_height);
ffmpegdec->pool_format = picture->format;
ffmpegdec->pool_info = info;
}
@ -2203,7 +2204,9 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
gst_object_unref (ffmpegdec->internal_pool);
ffmpegdec->internal_pool = gst_object_ref (pool);
ffmpegdec->pool_width = GST_VIDEO_INFO_WIDTH (&state->info);
ffmpegdec->pool_height = GST_VIDEO_INFO_HEIGHT (&state->info);
ffmpegdec->pool_height =
MAX (GST_VIDEO_INFO_HEIGHT (&state->info),
ffmpegdec->context->coded_height);
ffmpegdec->pool_info = state->info;
gst_structure_free (config);
goto done;