summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2016-11-04 00:52:28 +0000
committerLionel Landwerlin <llandwerlin@gmail.com>2016-11-04 00:52:30 +0000
commit21698256a1b6466cd92f7d222ed8c08b51bb481e (patch)
tree010abcc28814bff1ba76b95d300c01e054cd489c
parent6b69b6d81082b6b57773ac2d2ae0460cb0190334 (diff)
downloadclutter-gst-21698256a1b6466cd92f7d222ed8c08b51bb481e.tar.gz
content: fix segfault when sink emits a NULL frame
This happens when shutting down a pipeline. This was also supposed to be handled, just go it wrong. https://bugzilla.gnome.org/show_bug.cgi?id=773810
-rw-r--r--clutter-gst/clutter-gst-content.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/clutter-gst/clutter-gst-content.c b/clutter-gst/clutter-gst-content.c
index 02b1bb6..20db2c7 100644
--- a/clutter-gst/clutter-gst-content.c
+++ b/clutter-gst/clutter-gst-content.c
@@ -36,6 +36,8 @@
#include "config.h"
#endif
+#include <string.h>
+
#include "clutter-gst-content.h"
#include "clutter-gst-private.h"
#include "clutter-gst-marshal.h"
@@ -146,24 +148,19 @@ update_frame (ClutterGstContent *self,
{
ClutterGstContentPrivate *priv = self->priv;
ClutterGstFrame *old_frame;
+ ClutterGstVideoResolution old_res = { 0, }, new_res = { 0, };
old_frame = priv->current_frame;
priv->current_frame = g_boxed_copy (CLUTTER_GST_TYPE_FRAME, new_frame);
if (old_frame)
- {
- new_frame->resolution.par_n = old_frame->resolution.par_n;
- new_frame->resolution.par_d = old_frame->resolution.par_d;
- }
+ old_res = old_frame->resolution;
+ if (new_frame)
+ new_res = new_frame->resolution;
- if (!old_frame ||
- (new_frame->resolution.width != old_frame->resolution.width ||
- new_frame->resolution.height != old_frame->resolution.height))
- {
- g_signal_emit (self, signals[SIZE_CHANGE], 0,
- new_frame->resolution.width,
- new_frame->resolution.height);
- }
+ if (memcmp(&old_res, &new_res, sizeof(old_res)) != 0)
+ g_signal_emit (self, signals[SIZE_CHANGE], 0,
+ new_res.width, new_res.height);
if (old_frame)
g_boxed_free (CLUTTER_GST_TYPE_FRAME, old_frame);