openjpegdec: allow multithread decoding only in subframe mode

To avoid mis-ordered frames, allow multithread decoding only in
subframe mode.

Fixes #1786

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4275>
This commit is contained in:
Stéphane Cerveau 2023-02-13 12:05:27 +01:00 committed by GStreamer Marge Bot
parent f6934e6de6
commit 73b16af81c

View file

@ -217,10 +217,14 @@ gst_openjpeg_dec_start (GstVideoDecoder * decoder)
GST_DEBUG_OBJECT (self, "Starting"); GST_DEBUG_OBJECT (self, "Starting");
self->available_threads = self->max_slice_threads; self->available_threads = self->max_slice_threads;
if (self->available_threads) self->decode_frame = gst_openjpeg_dec_decode_frame_single;
if (self->available_threads) {
if (gst_video_decoder_get_subframe_mode (decoder))
self->decode_frame = gst_openjpeg_dec_decode_frame_multiple; self->decode_frame = gst_openjpeg_dec_decode_frame_multiple;
else else
self->decode_frame = gst_openjpeg_dec_decode_frame_single; GST_INFO_OBJECT (self,
"Multiple threads decoding only available in subframe mode.");
}
return TRUE; return TRUE;
} }