From: Sameer Naik Date: Sun, 28 Sep 2008 17:31:37 +0000 (+0000) Subject: ext/mad/gstmad.*: Fix compilation with --disable-index. Fixes bug #554142. X-Git-Tag: 1.19.3~505^2~1531 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ffc4369fb589d72432f416e4a51a9cecd78df60d;p=platform%2Fupstream%2Fgstreamer.git ext/mad/gstmad.*: Fix compilation with --disable-index. Fixes bug #554142. Original commit message from CVS: Patch by: Sameer Naik * ext/mad/gstmad.c: (gst_mad_class_init), (gst_mad_dispose), (gst_mad_src_event), (gst_mad_chain): * ext/mad/gstmad.h: Fix compilation with --disable-index. Fixes bug #554142. --- diff --git a/ChangeLog b/ChangeLog index feeef98..312e7aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-09-28 Sebastian Dröge + + Patch by: Sameer Naik + + * ext/mad/gstmad.c: (gst_mad_class_init), (gst_mad_dispose), + (gst_mad_src_event), (gst_mad_chain): + * ext/mad/gstmad.h: + Fix compilation with --disable-index. Fixes bug #554142. + 2008-09-27 Jan Schmidt * ext/a52dec/gsta52dec.c: diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index e9bb077..4b4c9fd 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -109,8 +109,10 @@ static GstFlowReturn gst_mad_chain (GstPad * pad, GstBuffer * buffer); static GstStateChangeReturn gst_mad_change_state (GstElement * element, GstStateChange transition); +#ifndef GST_DISABLE_INDEX static void gst_mad_set_index (GstElement * element, GstIndex * index); static GstIndex *gst_mad_get_index (GstElement * element); +#endif static void _do_init (GType type) @@ -192,6 +194,7 @@ gst_mad_base_init (gpointer g_class) gst_static_pad_template_get (&mad_src_template_factory)); gst_element_class_set_details (element_class, &gst_mad_details); } + static void gst_mad_class_init (GstMadClass * klass) { @@ -208,8 +211,10 @@ gst_mad_class_init (GstMadClass * klass) gobject_class->dispose = gst_mad_dispose; gstelement_class->change_state = gst_mad_change_state; +#ifndef GST_DISABLE_INDEX gstelement_class->set_index = gst_mad_set_index; gstelement_class->get_index = gst_mad_get_index; +#endif /* init properties */ /* currently, string representations are used, we might want to change that */ @@ -293,7 +298,9 @@ gst_mad_dispose (GObject * object) { GstMad *mad = GST_MAD (object); +#ifndef GST_DISABLE_INDEX gst_mad_set_index (GST_ELEMENT (object), NULL); +#endif g_free (mad->tempbuffer); mad->tempbuffer = NULL; @@ -305,6 +312,7 @@ gst_mad_dispose (GObject * object) G_OBJECT_CLASS (parent_class)->dispose (object); } +#ifndef GST_DISABLE_INDEX static void gst_mad_set_index (GstElement * element, GstIndex * index) { @@ -323,6 +331,7 @@ gst_mad_get_index (GstElement * element) return mad->index; } +#endif static gboolean gst_mad_convert_sink (GstPad * pad, GstFormat src_format, gint64 src_value, @@ -606,6 +615,7 @@ error: return FALSE; } +#ifndef GST_DISABLE_INDEX static gboolean index_seek (GstMad * mad, GstPad * pad, GstEvent * event) { @@ -679,6 +689,7 @@ index_seek (GstMad * mad, GstPad * pad, GstEvent * event) return FALSE; } +#endif static gboolean normal_seek (GstMad * mad, GstPad * pad, GstEvent * event) @@ -804,9 +815,11 @@ gst_mad_src_event (GstPad * pad, GstEvent * event) case GST_EVENT_SEEK: gst_event_ref (event); if (!(res = gst_pad_event_default (pad, event))) { +#ifndef GST_DISABLE_INDEX if (mad->index) res = index_seek (mad, pad, event); else +#endif res = normal_seek (mad, pad, event); } break; @@ -864,6 +877,7 @@ gst_mad_set_property (GObject * object, guint prop_id, break; } } + static void gst_mad_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) @@ -1544,12 +1558,14 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) GST_SECOND, mad->rate) - time_offset; } +#ifndef GST_DISABLE_INDEX if (mad->index) { guint64 x_bytes = mad->base_byte_offset + mad->bytes_consumed; gst_index_add_association (mad->index, mad->index_id, 0, GST_FORMAT_BYTES, x_bytes, GST_FORMAT_TIME, time_offset, NULL); } +#endif if (mad->segment_start <= (time_offset == GST_CLOCK_TIME_NONE ? 0 : time_offset)) { diff --git a/ext/mad/gstmad.h b/ext/mad/gstmad.h index 3f0177f..b652ac2 100644 --- a/ext/mad/gstmad.h +++ b/ext/mad/gstmad.h @@ -85,8 +85,10 @@ struct _GstMad gint times_pending; gboolean caps_set; /* used to keep track of whether to change/update caps */ +#ifndef GST_DISABLE_INDEX GstIndex *index; gint index_id; +#endif gboolean check_for_xing; gboolean xing_found;