GtkMediaStream doesnt detect errors on backend
I've been trying to build an application that plays a live video from a network url.
It's almost perfect. One of the bugs i'm dealing right now is when the backend throws two specific errors and the video stops playing but gtk_media_stream_get_error
returns NULL
thus not allowing my code to detect that the error occurred.
Code to reproduce this issue:
GFile* file = g_file_new_for_uri("http://livestreamingurl");
GtkMediaStream* MediaStream = gtk_media_file_new_for_file (file);
g_object_unref(file);
gtk_video_set_media_stream (video, MediaStream);
gtk_media_stream_play (MediaStream);
g_object_unref(MediaStream);
This happens for any live streaming that for some reason causes warnings like
0:06:39.189502460 412656 0x55e822a0b9e0 WARN videodecoder gstvideodecoder.c:3672:gst_video_decoder_clip_and_push_buf:<vaapidecode7> Dropping frame due to QoS. start:0:01:35.333333333 deadline:0:01:34.633333333 earliest_time:2064387:09:07.326417291
or
0:10:35.043143937 417852 0x7f64b412a360 WARN audiobasesink gstaudiobasesink.c:1786:gst_audio_base_sink_get_alignment:<pulsesink47> Unexpected discontinuity in audio timestamps of +0:00:00.304013605, resyncing
0:11:38.702540418 417852 0x7f64a8166060 WARN pulse pulsesink.c:703:gst_pulsering_stream_underflow_cb:<pulsesink47> Got underflow
I could see the errors running my application with G_MESSAGES_DEBUG=all
and GST_DEBUG=2
.
When overflow occurs the streaming doesn't freeze, only underflow. I know this might not be a GtkMediaStream bug but shouldn't an error be thrown whenever video stops for whatever reason it does?
Current behavior
While live streaming with GtkVideo, GtkMediaStream and GStreamer backend theres no way to recover from errors and the streaming stops but gtk_media_stream_get_error()
returns NULL
and playing
property is still set to true
.
Expected outcome
The Error property should be set to something not NULL.
Version information
GTK 4.8.2
Arch Linux