openh264dec: Drop current frame if passing it to the decoder caused an error

Otherwise we will get it again later for output, however this frame will
never actually be output so we will shift timestamps.

This is especially bad if we're handling a live stream where the first
frames are not keyframes. We would output the keyframe with the
timestamp of the first frame, and everything would be too late when
arriving in the sink.
This commit is contained in:
Sebastian Dröge 2017-08-10 23:25:13 +03:00
parent a04c48fec1
commit d1eb5f727c

View file

@ -234,6 +234,9 @@ gst_openh264dec_handle_frame (GstVideoDecoder * decoder,
}
gst_buffer_unmap (frame->input_buffer, &map_info);
if (ret != dsErrorFree)
return gst_video_decoder_drop_frame (decoder, frame);
gst_video_codec_frame_unref (frame);
frame = NULL;
} else {