avcfg: Simplify code

The existence of 'opt' is checked, the remainder of the code can therefore
rely on it being valid.

CID #1439537
This commit is contained in:
Edward Hervey 2018-09-21 11:30:58 +02:00 committed by Edward Hervey
parent 5e4f6cadb0
commit 143aa80cdf

View file

@ -461,15 +461,12 @@ gst_ffmpeg_cfg_get_property (AVCodecContext * refcontext, GValue * value,
GParamSpec * pspec)
{
const AVOption *opt;
int res = -1;
opt = g_param_spec_get_qdata (pspec, avoption_quark);
if (!opt) {
if (!opt)
return FALSE;
}
if (opt) {
int res = -1;
switch (G_PARAM_SPEC_VALUE_TYPE (pspec)) {
case G_TYPE_INT:
@ -547,10 +544,8 @@ gst_ffmpeg_cfg_get_property (AVCodecContext * refcontext, GValue * value,
g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
}
}
return res >= 0;
}
return TRUE;
return res >= 0;
}
void