浏览代码

obs-outputs: Revert f1f49bc1 to fix RTMP authentication

This reverts commit f1f49bc197f44f1f20cb268da2f9fdcda82049a0, which
breaks RTMP authentication as these parameters are intended to "leak"
into the next use of the RTMP context.
Richard Stanway 7 年之前
父节点
当前提交
c68d022f9c
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      plugins/obs-outputs/librtmp/rtmp.c

+ 6 - 6
plugins/obs-outputs/librtmp/rtmp.c

@@ -4519,14 +4519,14 @@ RTMP_Close(RTMP *r)
     r->m_customSendParam = NULL;
 
 #if defined(CRYPTO) || defined(USE_ONLY_MD5)
-    for (int idx = 0; idx < r->Link.nStreams; idx++)
-    {
-        free(r->Link.streams[idx].playpath.av_val);
-        r->Link.streams[idx].playpath.av_val = NULL;
-    }
-
     if (!(r->Link.protocol & RTMP_FEATURE_WRITE) || (r->Link.pFlags & RTMP_PUB_CLEAN))
     {
+        for (int idx = 0; idx < r->Link.nStreams; idx++)
+        {
+            free(r->Link.streams[idx].playpath.av_val);
+            r->Link.streams[idx].playpath.av_val = NULL;
+        }
+
         r->Link.curStreamIdx = 0;
         r->Link.nStreams = 0;
     }