[vlc-commits] [Git][videolan/vlc][master] avcodec: simplify lavc_UpdateVideoFormat check

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Nov 18 09:36:59 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
f80e843c by Alexandre Janniaux at 2021-11-18T09:17:11+00:00
avcodec: simplify lavc_UpdateVideoFormat check

lavc_UpdateVideoFormat is returning an error when init_device is NULL.
In addition, a NULL init_device cannot happens since this function
expects NULL as pointer-to-pointer to actually allow (and disable the
loading of) a NULL decoder device.

The check was necessary when c06a7fd2fdc68ce71d330d3c64f4111c4238b0d2
was introduced, but 1798f25add0dae0fc7c3be5e0aca179af0ba9218 fixed the
return value in this case.

This unify the calling of the function with the `,NULL)` version.

- - - - -


1 changed file:

- modules/codec/avcodec/video.c


Changes:

=====================================
modules/codec/avcodec/video.c
=====================================
@@ -1679,8 +1679,7 @@ no_reuse:
         const AVPixFmtDescriptor *dsc = av_pix_fmt_desc_get(hwfmt);
         vlc_decoder_device *init_device = NULL;
         msg_Dbg(p_dec, "trying format %s", dsc ? dsc->name : "unknown");
-        if (lavc_UpdateVideoFormat(p_dec, p_context, hwfmt, swfmt, &init_device) ||
-            init_device == NULL)
+        if (lavc_UpdateVideoFormat(p_dec, p_context, hwfmt, swfmt, &init_device))
             continue; /* Unsupported brand of hardware acceleration */
         vlc_mutex_unlock(&p_sys->lock);
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f80e843cbc8df2c734d559c9b5bf4da7db81ffac

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f80e843cbc8df2c734d559c9b5bf4da7db81ffac
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list