mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
avviddec: Don't believe we're negotiated if negotiation failed
It can happen that negotiation fails during get_buffer(), but then we don't retry later and never return NOT_NEGOTIATED upstream... and instead run into assertions.
This commit is contained in:
parent
9febec71c0
commit
5f5b6f465c
1 changed files with 17 additions and 1 deletions
|
@ -947,7 +947,8 @@ gst_ffmpegviddec_negotiate (GstFFMpegVidDec * ffmpegdec,
|
|||
/* calculate and update par now */
|
||||
gst_ffmpegviddec_update_par (ffmpegdec, in_info, out_info);
|
||||
|
||||
gst_video_decoder_negotiate (GST_VIDEO_DECODER (ffmpegdec));
|
||||
if (!gst_video_decoder_negotiate (GST_VIDEO_DECODER (ffmpegdec)))
|
||||
goto negotiate_failed;
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -958,6 +959,21 @@ unknown_format:
|
|||
"decoder requires a video format unsupported by GStreamer");
|
||||
return FALSE;
|
||||
}
|
||||
negotiate_failed:
|
||||
{
|
||||
/* Reset so we try again next time even if force==FALSE */
|
||||
ffmpegdec->ctx_width = 0;
|
||||
ffmpegdec->ctx_height = 0;
|
||||
ffmpegdec->ctx_ticks = 0;
|
||||
ffmpegdec->ctx_time_n = 0;
|
||||
ffmpegdec->ctx_time_d = 0;
|
||||
ffmpegdec->ctx_pix_fmt = 0;
|
||||
ffmpegdec->ctx_par_n = 0;
|
||||
ffmpegdec->ctx_par_d = 0;
|
||||
|
||||
GST_ERROR_OBJECT (ffmpegdec, "negotiation failed");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* perform qos calculations before decoding the next frame.
|
||||
|
|
Loading…
Reference in a new issue