mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
ffmpegviddec: Properly return if negotiation fails
Instead of crashing ....
This commit is contained in:
parent
ce7f65f752
commit
1db8779252
1 changed files with 11 additions and 2 deletions
|
@ -1089,7 +1089,8 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec,
|
||||||
else
|
else
|
||||||
GST_VIDEO_INFO_INTERLACE_MODE (&ffmpegdec->input_state->info) =
|
GST_VIDEO_INFO_INTERLACE_MODE (&ffmpegdec->input_state->info) =
|
||||||
GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
|
GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
|
||||||
gst_ffmpegviddec_negotiate (ffmpegdec, TRUE);
|
if (!gst_ffmpegviddec_negotiate (ffmpegdec, TRUE))
|
||||||
|
goto negotiation_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_UNLIKELY (out_frame->output_buffer == NULL))
|
if (G_UNLIKELY (out_frame->output_buffer == NULL))
|
||||||
|
@ -1110,7 +1111,8 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec,
|
||||||
else
|
else
|
||||||
GST_VIDEO_INFO_INTERLACE_MODE (&ffmpegdec->input_state->info) =
|
GST_VIDEO_INFO_INTERLACE_MODE (&ffmpegdec->input_state->info) =
|
||||||
GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
|
GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
|
||||||
gst_ffmpegviddec_negotiate (ffmpegdec, TRUE);
|
if (!gst_ffmpegviddec_negotiate (ffmpegdec, TRUE))
|
||||||
|
goto negotiation_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if we are dealing with a keyframe here, this will also check if we
|
/* check if we are dealing with a keyframe here, this will also check if we
|
||||||
|
@ -1163,6 +1165,13 @@ no_output:
|
||||||
len = -1;
|
len = -1;
|
||||||
goto beach;
|
goto beach;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
negotiation_error:
|
||||||
|
{
|
||||||
|
GST_WARNING_OBJECT (ffmpegdec, "Error negotiating format");
|
||||||
|
*ret = GST_FLOW_NOT_NEGOTIATED;
|
||||||
|
goto beach;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue