encoder: h264: fix profile limits. 96/33096/1
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 25 Nov 2014 10:41:49 +0000 (11:41 +0100)
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>
Mon, 5 Jan 2015 15:55:20 +0000 (16:55 +0100)
Fix ensure_profile_limits() to lower profile to the desired limits,
only if the latter are actually known and the profile needed to be
changed to fit.

Change-Id: Id0a7b26e7cf6e6b5473e7208477a0f00af30a78c
Origin: upstream
Bug-Tizen: TC-2113/part

gst-libs/gst/vaapi/gstvaapiencoder_h264.c

index 3277f00..ee74020 100644 (file)
@@ -1005,6 +1005,8 @@ ensure_profile_limits (GstVaapiEncoderH264 * encoder)
 
   GST_WARNING ("lowering coding tools to meet target decoder constraints");
 
+  profile = GST_VAAPI_PROFILE_UNKNOWN;
+
   /* Try Main profile coding tools */
   if (encoder->max_profile_idc < 100) {
     encoder->use_dct8x8 = FALSE;
@@ -1018,8 +1020,10 @@ ensure_profile_limits (GstVaapiEncoderH264 * encoder)
     profile = GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE;
   }
 
-  encoder->profile = profile;
-  encoder->profile_idc = encoder->max_profile_idc;
+  if (profile) {
+    encoder->profile = profile;
+    encoder->profile_idc = encoder->max_profile_idc;
+  }
   return TRUE;
 }