vtenc: Check if VTSessionCopyProperty() succeeds before using the result

https://bugzilla.gnome.org/show_bug.cgi?id=744585
This commit is contained in:
Sebastian Dröge 2015-02-16 12:35:09 +02:00
parent 282dbcee0b
commit 0c9f35653f

View file

@ -1014,6 +1014,11 @@ gst_vtenc_update_latency (GstVTEnc * self)
status = VTSessionCopyProperty (self->session,
kVTCompressionPropertyKey_NumberOfPendingFrames, NULL, &value);
if (status != noErr || !value) {
GST_INFO_OBJECT (self, "failed to get NumberOfPendingFrames: %d", status);
return;
}
CFNumberGetValue (value, kCFNumberSInt32Type, &frames);
if (self->latency_frames == -1 || self->latency_frames != frames) {
self->latency_frames = frames;