-
Notifications
You must be signed in to change notification settings - Fork 17
Fix output publish timing and Windows FFmpeg lookup #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,10 +15,29 @@ MoQOutput::MoQOutput(obs_data_t *, obs_output_t *output) | |
| connect_time_ms(0), | ||
| origin(moq_origin_create()), | ||
| session(0), | ||
| broadcast(moq_publish_create()) | ||
| broadcast(moq_publish_create()), | ||
| broadcast_published(false) | ||
| { | ||
| } | ||
|
|
||
| bool MoQOutput::PublishBroadcast() | ||
| { | ||
| if (broadcast_published) { | ||
| return true; | ||
| } | ||
|
|
||
| LOG_INFO("Publishing broadcast: %s", path.c_str()); | ||
|
|
||
| auto result = moq_origin_publish(origin, path.data(), path.size(), broadcast); | ||
| if (result < 0) { | ||
| LOG_ERROR("Failed to publish broadcast to session: %d", result); | ||
| return false; | ||
| } | ||
|
|
||
| broadcast_published = true; | ||
| return true; | ||
| } | ||
|
Comment on lines
+23
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reset publish state per session, not per object lifetime. At Line 25, Suggested fix bool MoQOutput::Start()
{
@@
// Path (broadcast name) is optional; an empty string publishes to the unnamed broadcast.
const char *path_value = obs_service_get_connect_info(service, OBS_SERVICE_CONNECT_INFO_STREAM_KEY);
path = path_value ? path_value : "";
+ broadcast_published = false;
@@
}🤖 Prompt for AI Agents |
||
|
|
||
| MoQOutput::~MoQOutput() | ||
| { | ||
| moq_publish_close(broadcast); | ||
|
|
@@ -80,6 +99,11 @@ bool MoQOutput::Start() | |
| auto self = static_cast<MoQOutput *>(user_data); | ||
|
|
||
| if (error_code == 0) { | ||
| if (!self->PublishBroadcast()) { | ||
| obs_output_signal_stop(self->output, OBS_OUTPUT_ERROR); | ||
| return; | ||
| } | ||
|
|
||
| auto elapsed = std::chrono::steady_clock::now() - self->connect_start; | ||
| self->connect_time_ms = static_cast<int>(std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count()); | ||
| LOG_INFO("MoQ session established (%d ms): %s", self->connect_time_ms, | ||
|
|
@@ -97,16 +121,6 @@ bool MoQOutput::Start() | |
| return false; | ||
| } | ||
|
|
||
| LOG_INFO("Publishing broadcast: %s", path.c_str()); | ||
|
|
||
| // Publish the broadcast to the origin we created. | ||
| // TODO: There is currently no unpublish function. | ||
| auto result = moq_origin_publish(origin, path.data(), path.size(), broadcast); | ||
| if (result < 0) { | ||
| LOG_ERROR("Failed to publish broadcast to session: %d", result); | ||
| return false; | ||
| } | ||
|
|
||
| obs_output_begin_data_capture(output, 0); | ||
|
|
||
| return true; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the required
[obs-moq]prefix to new log messages.Line 29 and Line 33 use project logging macros but omit the required prefix, which makes filtering/attribution inconsistent.
Suggested fix
As per coding guidelines,
**/*.{cpp,h,hpp}must useLOG_DEBUG(),LOG_INFO(),LOG_WARNING(),LOG_ERROR()with[obs-moq]prefix.📝 Committable suggestion
🤖 Prompt for AI Agents