diff options
author | Edward Hervey <edward@centricular.com> | 2021-04-24 10:04:23 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-04-27 19:23:48 +0100 |
commit | 0d9554d95b08d54a3ae126bb0a6189dfa708cf7e (patch) | |
tree | afcabbb9af6786e635d43cf362553ac8941e370d | |
parent | 801dc93b790e9a96aa437a3f344214170c0bd540 (diff) | |
download | gst-libav-0d9554d95b08d54a3ae126bb0a6189dfa708cf7e.tar.gz |
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/132>
-rw-r--r-- | ext/libav/gstavviddec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index 72077ed..c3698ef 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -770,7 +770,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; } @@ -2139,7 +2140,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; |