Skip to content

Commit

Permalink
vdec/gpujpeg: set the default GJ params (probe)
Browse files Browse the repository at this point in the history
At least the struct gpujpeg_image_parameters is input/output - the
pixel_format is read from there (to evaluate if alpha formats should
be presented). So better initialize it correctly - now it perhaps doesn't
matter but to be future-proof.
  • Loading branch information
MartinPulec committed Apr 8, 2024
1 parent d53db9d commit f46eda2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video_decompress/gpujpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@ static int gpujpeg_decompress_reconfigure(void *state, struct video_desc desc,

static decompress_status gpujpeg_probe_internal_codec(unsigned char *buffer, size_t len, struct pixfmt_desc *internal_prop) {
struct gpujpeg_image_parameters image_params = { 0 };
gpujpeg_image_set_default_parameters(&image_params);
#if GPUJPEG_VERSION_INT >= GPUJPEG_MK_VERSION_INT(0, 20, 0)
struct gpujpeg_parameters params = { .verbose = MAX(0, log_level - LOG_LEVEL_INFO) };
struct gpujpeg_parameters params;
gpujpeg_set_default_parameters(&params);
params.verbose = MAX(0, log_level - LOG_LEVEL_INFO);
if (gpujpeg_decoder_get_image_info(buffer, len, &image_params, &params, NULL) != 0) {
#else
if (gpujpeg_decoder_get_image_info(buffer, len, &image_params, NULL, MAX(0, log_level - LOG_LEVEL_INFO)) != 0) {
Expand Down

0 comments on commit f46eda2

Please sign in to comment.