Skip to content

Commit 4a57459

Browse files
committed
Fixed an issue where AdmissionWebhooks was called twice when using E-RTMP with FFmpeg (#1991)
1 parent e6b62a0 commit 4a57459

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/projects/providers/rtmp/handlers/rtmp_chunk_handler.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,9 @@ namespace pvd::rtmp
822822

823823
return false;
824824
}
825-
826-
return _stream->PostPublish(document);
827825
}
828-
829-
return true;
826+
827+
return _stream->PostPublish(document);
830828
}
831829

832830
bool RtmpChunkHandler::OnAmfMetadata(const std::shared_ptr<const modules::rtmp::ChunkHeader> &header, const modules::rtmp::AmfProperty *property)

src/projects/providers/rtmp/rtmp_stream_v2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ namespace pvd::rtmp
225225

226226
bool RtmpStreamV2::PostPublish(const modules::rtmp::AmfDocument &document)
227227
{
228+
if (_is_post_published)
229+
{
230+
return _is_post_published;
231+
}
232+
228233
auto requested_url = GetRequestedUrl();
229234

230235
if (requested_url == nullptr)

src/projects/providers/rtmp/rtmp_stream_v2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace pvd::rtmp
9595
RtmpHandshakeHandler _handshake_handler;
9696
RtmpChunkHandler _chunk_handler;
9797

98-
bool _is_post_published = false;
98+
std::atomic<bool> _is_post_published = false;
9999

100100
// To make first PTS 0
101101
bool _first_frame = true;

0 commit comments

Comments
 (0)