diff --git a/ext/openh264/gstopenh264enc.cpp b/ext/openh264/gstopenh264enc.cpp
index aa8138d7d6233a8e8ad38a9babfffd447965d479..11be2a5b648afd73f1a921a0bcfe4c90dfdd4497 100644
--- a/ext/openh264/gstopenh264enc.cpp
+++ b/ext/openh264/gstopenh264enc.cpp
@@ -739,7 +739,7 @@ gst_openh264enc_set_format (GstVideoEncoder * encoder,
   enc_params.bEnableSceneChangeDetect = openh264enc->scene_change_detection;
   enc_params.bEnableFrameSkip = openh264enc->enable_frame_skip;
   enc_params.bEnableLongTermReference = 0;
-#if OPENH264_MINOR >= 4
+#if (OPENH264_MAJOR > 1 || (OPENH264_MAJOR == 1 && OPENH264_MINOR >= 4))
   enc_params.eSpsPpsIdStrategy = CONSTANT_ID;
 #else
   enc_params.bEnableSpsPpsIdAddition = 0;