From 34eaeb17f230424513af2b25c8b9062a7b27577c Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 15 Mar 2019 11:03:52 +0100 Subject: [PATCH] srtpdec: Simplify locking in gst_srtp_dec_decode_buffer Don't drop the lock on filter just to unmap the buffer (or log a message). --- ext/srtp/gstsrtpdec.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ext/srtp/gstsrtpdec.c b/ext/srtp/gstsrtpdec.c index 0e8b137..b5d6388 100644 --- a/ext/srtp/gstsrtpdec.c +++ b/ext/srtp/gstsrtpdec.c @@ -1382,8 +1382,6 @@ unprotect: #endif } - GST_OBJECT_UNLOCK (filter); - if (err != srtp_err_status_ok) { GST_WARNING_OBJECT (pad, "Unable to unprotect buffer (unprotect failed code %d)", err); @@ -1391,7 +1389,6 @@ unprotect: /* Signal user depending on type of error */ switch (err) { case srtp_err_status_key_expired: - GST_OBJECT_LOCK (filter); /* Update stream */ if (find_stream_by_ssrc (filter, ssrc)) { @@ -1400,6 +1397,7 @@ unprotect: GST_OBJECT_LOCK (filter); goto unprotect; } else { + GST_OBJECT_LOCK (filter); GST_WARNING_OBJECT (filter, "Hard limit reached, no new key, " "dropping"); } @@ -1420,16 +1418,11 @@ unprotect: } gst_buffer_unmap (buf, &map); - - GST_OBJECT_LOCK (filter); return FALSE; } gst_buffer_unmap (buf, &map); - gst_buffer_set_size (buf, size); - - GST_OBJECT_LOCK (filter); return TRUE; } -- 2.7.4