From d18d4fd5a1986d59af029a482e094a3707828438 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 26 May 2002 21:59:21 +0000 Subject: - Changed plugins for new APIs Original commit message from CVS: - Changed plugins for new APIs - modularized audiofile. - added seeking, query and convert functions for mad, mpeg2dec, avidemux, mpegdemux, mpegparse - sync updates to oss. removed the ossclock for now --- ext/audiofile/gstafparse.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'ext/audiofile/gstafparse.c') diff --git a/ext/audiofile/gstafparse.c b/ext/audiofile/gstafparse.c index 32a12dce..5067ea1f 100644 --- a/ext/audiofile/gstafparse.c +++ b/ext/audiofile/gstafparse.c @@ -180,7 +180,7 @@ gst_afparse_loop(GstElement *element) GstAFParse *afparse; GstBuffer *buf; GstBufferPool *bufpool; - gint numframes, frames_to_bytes, frames_per_read, bytes_per_read; + gint numframes = 0, frames_to_bytes, frames_per_read, bytes_per_read; guint8 *data; gboolean bypass_afread = TRUE; GstByteStream *bs; @@ -315,8 +315,8 @@ gst_afparse_get_property (GObject *object, guint prop_id, GValue *value, GParamS } } -static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +gboolean +gst_afparse_plugin_init (GModule *module, GstPlugin *plugin) { GstElementFactory *factory; @@ -343,14 +343,6 @@ plugin_init (GModule *module, GstPlugin *plugin) return TRUE; } - -GstPluginDesc plugin_desc = { - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "afparse", - plugin_init -}; - /* this is where we open the audiofile */ static gboolean gst_afparse_open_file (GstAFParse *afparse) @@ -483,7 +475,7 @@ static long gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative) { GstByteStream *bs = (GstByteStream*)vfile->closure; - GstSeekType type; + GstSeekType method; guint64 current_offset = gst_bytestream_tell(bs); if (!is_relative){ @@ -492,16 +484,15 @@ gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative) return offset; } - type = GST_SEEK_BYTEOFFSET_SET; + method = GST_SEEK_METHOD_SET; } else { if (offset == 0) return current_offset; - type = GST_SEEK_BYTEOFFSET_CUR; + method = GST_SEEK_METHOD_CUR; } - - g_print("doing seek to %d, current offset %lld\n", (gint)offset, current_offset); - if (gst_bytestream_seek(bs, type, (gint64)offset)){ - + + if (gst_bytestream_seek(bs, (gint64)offset, method)){ + g_print("doing seek to %d\n", (gint)offset); return offset; } return 0; -- cgit v1.2.1