mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
vp8dec: Correctly initialize stream info before peeking at the stream
Otherwise peeking will fail and we'll get invalid values
This commit is contained in:
parent
16f6ed7195
commit
ac7cba4ac2
1 changed files with 6 additions and 3 deletions
|
@ -276,7 +276,7 @@ gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame)
|
|||
long status;
|
||||
vpx_codec_iter_t iter = NULL;
|
||||
vpx_image_t *img;
|
||||
|
||||
vpx_codec_err_t res;
|
||||
|
||||
GST_DEBUG ("handle_frame");
|
||||
|
||||
|
@ -285,11 +285,14 @@ gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame)
|
|||
if (!dec->decoder_inited) {
|
||||
vpx_codec_stream_info_t stream_info;
|
||||
|
||||
vpx_codec_peek_stream_info (&vpx_codec_vp8_dx_algo,
|
||||
memset (&stream_info, 0, sizeof (stream_info));
|
||||
stream_info.sz = sizeof (stream_info);
|
||||
|
||||
res = vpx_codec_peek_stream_info (&vpx_codec_vp8_dx_algo,
|
||||
GST_BUFFER_DATA (frame->sink_buffer),
|
||||
GST_BUFFER_SIZE (frame->sink_buffer), &stream_info);
|
||||
|
||||
if (!stream_info.is_kf) {
|
||||
if (res != VPX_CODEC_OK || !stream_info.is_kf) {
|
||||
gst_base_video_decoder_skip_frame (decoder, frame);
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue