From 090e1390480003fef368cce880e710580edffbd8 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 18 Jul 2012 18:32:54 +0200 Subject: [PATCH] mpeg2dec: Call gst_video_decoder_negotiate() --- ext/mpeg2dec/gstmpeg2dec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index 993dd9c132..caef8bb92e 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -714,6 +714,9 @@ handle_sequence (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info) gst_video_decoder_set_latency (GST_VIDEO_DECODER (mpeg2dec), latency, latency); + if (!gst_video_decoder_negotiate (GST_VIDEO_DECODER (mpeg2dec))) + goto negotiation_fail; + gst_video_codec_state_unref (state); mpeg2_custom_fbuf (mpeg2dec->decoder, 1); @@ -740,6 +743,12 @@ invalid_size: sequence->width, sequence->height); return GST_FLOW_ERROR; } + +negotiation_fail: + { + GST_WARNING_OBJECT (mpeg2dec, "Failed to negotiate with downstream"); + return GST_FLOW_ERROR; + } } static GstFlowReturn