mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
codecs: h264decoder: Drop non-decodable frames
Otherwise GstVideoDecoder baseclass will hold the corresponding broken frames until new reset event happens such as FLUSH or downwards state change. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1450>
This commit is contained in:
parent
597c1b4ec6
commit
14f6799f93
1 changed files with 6 additions and 1 deletions
|
@ -384,7 +384,6 @@ gst_h264_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||
}
|
||||
|
||||
gst_buffer_unmap (in_buf, &map);
|
||||
priv->current_frame = NULL;
|
||||
|
||||
if (!decode_ret) {
|
||||
GST_VIDEO_DECODER_ERROR (self, 1, STREAM, DECODE,
|
||||
|
@ -392,12 +391,14 @@ gst_h264_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||
gst_video_decoder_drop_frame (decoder, frame);
|
||||
|
||||
gst_h264_picture_clear (&priv->current_picture);
|
||||
priv->current_frame = NULL;
|
||||
|
||||
return priv->last_ret;
|
||||
}
|
||||
|
||||
gst_h264_decoder_finish_current_picture (self);
|
||||
gst_video_codec_frame_unref (frame);
|
||||
priv->current_frame = NULL;
|
||||
|
||||
return priv->last_ret;
|
||||
}
|
||||
|
@ -1263,6 +1264,10 @@ gst_h264_decoder_finish_current_picture (GstH264Decoder * self)
|
|||
priv->current_picture->frame_num,
|
||||
priv->current_picture->pic_order_cnt);
|
||||
priv->current_picture->nonexisting = TRUE;
|
||||
|
||||
/* this fake nonexisting picture will not trigger ouput_picture() */
|
||||
gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self),
|
||||
gst_video_codec_frame_ref (priv->current_frame));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue