summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2020-11-20 16:51:09 +1100
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-12-04 16:32:46 +0000
commit630e1e78b75722af0519361c414179149b740933 (patch)
tree8e33df753937fee5d3baf6b682754e26eb034ed7
parent5f4e2cd196883a66380d74c67704cd49e03774bd (diff)
downloadgstreamer-plugins-base-630e1e78b75722af0519361c414179149b740933.tar.gz
video/converter: increase the number of cache lines for resampling
The exising hardcoded max default does not account for the possible -1 offset when retrieving lines for resampling. As a result, when another chain has the same number of cache lines (4), the resample operation would be attempting to generate 5 lines with a cache size of 4 and would overwrite the first cache line. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/821 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/959>
-rw-r--r--gst-libs/gst/video/video-converter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c
index 2ee9e81eb..73f37b404 100644
--- a/gst-libs/gst/video/video-converter.c
+++ b/gst-libs/gst/video/video-converter.c
@@ -898,7 +898,8 @@ chain_upsample (GstVideoConverter * convert, GstLineCache * prev, gint idx)
prev = convert->upsample_lines[idx] = gst_line_cache_new (prev);
prev->write_input = TRUE;
prev->pass_alloc = TRUE;
- prev->n_lines = 4;
+ /* XXX: why this hardcoded value? */
+ prev->n_lines = 5;
prev->stride = convert->current_pstride * convert->current_width;
gst_line_cache_set_need_line_func (prev,
do_upsample_lines, idx, convert, NULL);
@@ -2002,7 +2003,8 @@ chain_downsample (GstVideoConverter * convert, GstLineCache * prev, gint idx)
prev = convert->downsample_lines[idx] = gst_line_cache_new (prev);
prev->write_input = TRUE;
prev->pass_alloc = TRUE;
- prev->n_lines = 4;
+ /* XXX: why this hardcoded value? */
+ prev->n_lines = 5;
prev->stride = convert->current_pstride * convert->current_width;
gst_line_cache_set_need_line_func (prev,
do_downsample_lines, idx, convert, NULL);