+2005-05-01 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_class_init),
+ (gst_ffmpegmux_finalize), (gst_ffmpegmux_loop),
+ (gst_ffmpegmux_change_state):
+ Fix possible segfaults (#302017).
+
2005-04-25 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event):
static void gst_ffmpegmux_class_init (GstFFMpegMuxClass * klass);
static void gst_ffmpegmux_base_init (GstFFMpegMuxClass * klass);
static void gst_ffmpegmux_init (GstFFMpegMux * ffmpegmux);
-static void gst_ffmpegmux_dispose (GObject * object);
+static void gst_ffmpegmux_finalize (GObject * object);
static GstPadLinkReturn
gst_ffmpegmux_connect (GstPad * pad, const GstCaps * caps);
gstelement_class->request_new_pad = gst_ffmpegmux_request_new_pad;
gstelement_class->change_state = gst_ffmpegmux_change_state;
- gobject_class->dispose = gst_ffmpegmux_dispose;
+ gobject_class->finalize = gst_ffmpegmux_finalize;
}
static void
}
static void
-gst_ffmpegmux_dispose (GObject * object)
+gst_ffmpegmux_finalize (GObject * object)
{
GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) object;
- if (ffmpegmux->opened) {
- url_fclose (&ffmpegmux->context->pb);
- ffmpegmux->opened = FALSE;
- }
-
g_free (ffmpegmux->context);
+
+ if (G_OBJECT_CLASS (parent_class)->finalize)
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
static GstPad *
} else {
/* close down */
av_write_trailer (ffmpegmux->context);
- url_fclose (&ffmpegmux->context->pb);
ffmpegmux->opened = FALSE;
+ url_fclose (&ffmpegmux->context->pb);
gst_element_set_eos (element);
}
}
ffmpegmux->tags = NULL;
}
if (ffmpegmux->opened) {
- url_fclose (&ffmpegmux->context->pb);
ffmpegmux->opened = FALSE;
+ url_fclose (&ffmpegmux->context->pb);
}
break;
}