From 5345ebd2b4b4d988fd8bfbe02bdcd230e6dc7aaf Mon Sep 17 00:00:00 2001 From: Erica Z Date: Sat, 12 Oct 2024 21:11:55 +0000 Subject: [PATCH] fix gstreamer user agent --- src/playbin.vala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/playbin.vala b/src/playbin.vala index 8c9f8ca..0b57e61 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -26,13 +26,15 @@ class Playbin : Object { public signal void stream_started (); public signal void stream_over (); + private void on_source_setup (Gst.Element playbin, dynamic Gst.Element source) { + source.user_agent = "audrey/0.1.0 (Linux)"; // AUDREY_VERSION + } + construct { this.playbin = Gst.ElementFactory.make ("playbin3", null); assert (this.playbin != null); - //dynamic Gst.Element souphttpsrc = ((Gst.Bin) this.playbin).get_by_name ("souphttpsrc0"); - //assert (souphttpsrc != null); - //souphttpsrc.user_agent = "audrey/0.1.0 (Linux)"; // AUDREY_VERSION + this.playbin.source_setup.connect (this.on_source_setup); // regularly update position Timeout.add (500, () => {