Commit 5f5b6f46 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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.
parent 9febec71
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment