mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
srt: Fix use of srt_startup
`srt_startup` can also return 1 if it was successful. Avoid warning in this case. Avoid a race when checking whether we need to call it at all. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
This commit is contained in:
parent
6b8c4a5f34
commit
fda4cfd15e
1 changed files with 2 additions and 4 deletions
|
@ -262,16 +262,14 @@ gst_srt_object_new (GstElement * element)
|
||||||
{
|
{
|
||||||
GstSRTObject *srtobject;
|
GstSRTObject *srtobject;
|
||||||
|
|
||||||
if (g_atomic_int_get (&srt_init_refcount) == 0) {
|
if (g_atomic_int_add (&srt_init_refcount, 1) == 0) {
|
||||||
GST_DEBUG_OBJECT (element, "Starting up SRT");
|
GST_DEBUG_OBJECT (element, "Starting up SRT");
|
||||||
if (srt_startup () != 0) {
|
if (srt_startup () < 0) {
|
||||||
g_warning ("Failed to initialize SRT (reason: %s)",
|
g_warning ("Failed to initialize SRT (reason: %s)",
|
||||||
srt_getlasterror_str ());
|
srt_getlasterror_str ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_atomic_int_inc (&srt_init_refcount);
|
|
||||||
|
|
||||||
srtobject = g_new0 (GstSRTObject, 1);
|
srtobject = g_new0 (GstSRTObject, 1);
|
||||||
srtobject->element = element;
|
srtobject->element = element;
|
||||||
srtobject->parameters = gst_structure_new_empty ("application/x-srt-params");
|
srtobject->parameters = gst_structure_new_empty ("application/x-srt-params");
|
||||||
|
|
Loading…
Reference in a new issue