Skip to content

Commit

Permalink
video-converter: Don't upsample/downsample/dither invalid lines
Browse files Browse the repository at this point in the history
This is a fallout from the conversion to support multiple threads.
convert->upsample_p is never NULL now, it's always an allocated array of
n_threads potentially-null pointers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1054>
  • Loading branch information
vivia authored and tp-m committed Feb 26, 2021
1 parent acc67a7 commit 6b86020
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gst-libs/gst/video/video-converter.c
Expand Up @@ -2906,7 +2906,7 @@ do_upsample_lines (GstLineCache * cache, gint idx, gint out_line, gint in_line,
gst_line_cache_get_lines (cache->prev, idx, out_line, start_line,
n_lines);

if (convert->upsample) {
if (convert->upsample[idx]) {
GST_DEBUG ("doing upsample %d-%d %p", start_line, start_line + n_lines - 1,
lines[0]);
gst_video_chroma_resample (convert->upsample[idx], lines,
Expand Down Expand Up @@ -3107,7 +3107,7 @@ do_downsample_lines (GstLineCache * cache, gint idx, gint out_line,
gst_line_cache_get_lines (cache->prev, idx, out_line, start_line,
n_lines);

if (convert->downsample) {
if (convert->downsample[idx]) {
GST_DEBUG ("downsample line %d %d-%d %p", in_line, start_line,
start_line + n_lines - 1, lines[0]);
gst_video_chroma_resample (convert->downsample[idx], lines,
Expand All @@ -3130,7 +3130,7 @@ do_dither_lines (GstLineCache * cache, gint idx, gint out_line, gint in_line,
lines = gst_line_cache_get_lines (cache->prev, idx, out_line, in_line, 1);
destline = lines[0];

if (convert->dither) {
if (convert->dither[idx]) {
GST_DEBUG ("Dither line %d %p", in_line, destline);
gst_video_dither_line (convert->dither[idx], destline, 0, out_line,
convert->out_width);
Expand Down

0 comments on commit 6b86020

Please sign in to comment.