mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
openh264: Don't use GOnce for ABI check
It turns out the value used for g_once_* APIs can't be zero. And this is a very cheap check, so let's just do it every time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2240>
This commit is contained in:
parent
8b595e7c8b
commit
761206291b
1 changed files with 8 additions and 16 deletions
|
@ -37,20 +37,12 @@
|
|||
gboolean
|
||||
openh264_element_init (GstPlugin * plugin)
|
||||
{
|
||||
static gsize res = FALSE;
|
||||
|
||||
if (g_once_init_enter (&res)) {
|
||||
gsize value;
|
||||
OpenH264Version libver;
|
||||
/* g_stCodecVersion is the version detected at build time as defined in the
|
||||
* headers and WelsGetCodecVersion() is the version detected at runtime.
|
||||
* This is a safeguard to avoid crashes since OpenH264 has been changing
|
||||
* ABI without changing the SONAME.
|
||||
*/
|
||||
libver = WelsGetCodecVersion ();
|
||||
value = memcmp (&libver, &g_stCodecVersion, sizeof (libver)) == 0;
|
||||
g_once_init_leave (&res, value);
|
||||
}
|
||||
|
||||
return res;
|
||||
OpenH264Version libver;
|
||||
/* g_stCodecVersion is the version detected at build time as defined in the
|
||||
* headers and WelsGetCodecVersion() is the version detected at runtime.
|
||||
* This is a safeguard to avoid crashes since OpenH264 has been changing
|
||||
* ABI without changing the SONAME.
|
||||
*/
|
||||
libver = WelsGetCodecVersion ();
|
||||
return (memcmp (&libver, &g_stCodecVersion, sizeof (libver)) == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue