If decoding failed because end_picture() failed, set the picture to
nonexisting, this way output_picture() will be skipped. This avoids confusing
special cases in output_picture() implementation.
klass = GST_H264_DECODER_GET_CLASS (self);
- if (klass->end_picture)
- ret = klass->end_picture (self, priv->current_picture);
+ if (klass->end_picture) {
+ if (!klass->end_picture (self, priv->current_picture))
+ priv->current_picture->nonexisting = TRUE;
+ }
/* finish picture takes ownership of the picture */
ret = gst_h264_decoder_finish_picture (self, priv->current_picture);