Skip to content

Commit

Permalink
src: logger: Only use gstreamer spam integration if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Apr 26, 2023
1 parent 7333db3 commit 7248d20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/logger/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ pub fn init() {
// Redirects all gstreamer logs to tracing.
tracing_gstreamer::integrate_events(); // This must be called before any gst::init()
gst::debug_remove_default_log_function();
gst::init().unwrap();
tracing_gstreamer::integrate_spans(); // This must be called after gst::init(), this is necessary to have GStreamer on tracy
// This fundamentally changes the CPU usage of our streams, so we are only enabling
// this integration if absolutely necessary.
if cli::manager::is_tracy() {
gst::init().unwrap();
tracing_gstreamer::integrate_spans(); // This must be called after gst::init(), this is necessary to have GStreamer on tracy
}

info!(
"{}, version: {}-{}, build date: {}",
Expand Down

0 comments on commit 7248d20

Please sign in to comment.