/* Error handling */
gint max_errors;
gint error_count;
+ gboolean had_output_data;
+ gboolean had_input_data;
gboolean do_caps;
flow_ret = gst_video_decoder_drain_out (decoder, TRUE);
ret = (flow_ret == GST_FLOW_OK);
+
+ /* Error out even if EOS was ok when we had input, but no output */
+ if (ret && priv->had_input_data && !priv->had_output_data) {
+ GST_ELEMENT_ERROR (decoder, STREAM, DECODE,
+ ("No valid frames decoded before end of stream"),
+ ("no valid frames found"));
+ }
+
/* Forward EOS immediately. This is required because no
* buffer or serialized event will come after EOS and
* nothing could trigger another _finish_frame() call.
priv->error_count = 0;
priv->max_errors = GST_VIDEO_DECODER_MAX_ERRORS;
+ priv->had_output_data = FALSE;
+ priv->had_input_data = FALSE;
GST_OBJECT_LOCK (decoder);
priv->earliest_time = GST_CLOCK_TIME_NONE;
g_list_prepend (decoder->priv->current_frame_events, event);
}
+ decoder->priv->had_input_data = TRUE;
+
if (decoder->input_segment.rate > 0.0)
ret = gst_video_decoder_chain_forward (decoder, buf, FALSE);
else
start = GST_BUFFER_PTS (buf);
duration = GST_BUFFER_DURATION (buf);
+ /* store that we have valid decoded data */
+ priv->had_output_data = TRUE;
+
stop = GST_CLOCK_TIME_NONE;
if (GST_CLOCK_TIME_IS_VALID (start) && GST_CLOCK_TIME_IS_VALID (duration)) {