This lets create_gstreamer_decoder() fail if it cannot create the pipeline it needs, allowing the caller to try fallbacks. This also means the pipeline has the same lifetime as the decoder which makes it possible to remove a check in queue_frame().
Signed-off-by: Francois Gouget <[email protected]> --- src/channel-display-gst.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c index c752639..647afc1 100644 --- a/src/channel-display-gst.c +++ b/src/channel-display-gst.c @@ -407,11 +407,6 @@ static void spice_gst_decoder_queue_frame(VideoDecoder *video_decoder, return; } - if (!decoder->pipeline && !create_pipeline(decoder)) { - stream_dropped_frame_on_playback(decoder->base.stream); - return; - } - /* ref() the frame_msg for the buffer */ spice_msg_in_ref(frame_msg); GstBuffer *buffer = gst_buffer_new_wrapped_full(GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS, @@ -463,6 +458,12 @@ VideoDecoder* create_gstreamer_decoder(int codec_type, display_stream *stream) g_mutex_init(&decoder->queues_mutex); decoder->decoding_queue = g_queue_new(); decoder->display_queue = g_queue_new(); + + if (!create_pipeline(decoder)) + { + decoder->base.destroy((VideoDecoder*)decoder); + decoder = NULL; + } } return (VideoDecoder*)decoder; @@ -475,7 +476,7 @@ gboolean gstvideo_has_codec(int codec_type) VideoDecoder *decoder = create_gstreamer_decoder(codec_type, NULL); if (decoder) { - has_codec = create_pipeline((SpiceGstDecoder*)decoder); + has_codec = TRUE; decoder->destroy(decoder); } -- 2.8.1 _______________________________________________ Spice-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/spice-devel
