From d403852f04b1137e12810eeceab95dc05d3c9ff7 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 31 Mar 2006 22:26:12 +0000 Subject: [PATCH] ext/ffmpeg/: various compiler fixes Original commit message from CVS: * ext/ffmpeg/gstffmpeg.c: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps): * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_add_pixel_aspect_ratio), (gst_ffmpegdec_frame): * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_seek): * ext/ffmpeg/gstffmpegscale.c: (gst_ffmpegscale_transform_caps), (gst_ffmpegscale_handle_src_event): various compiler fixes * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_event), (my_safe_copy), (gst_ffmpegdemux_open), (gst_ffmpegdemux_change_state): actually return the result. Tee hee. --- ChangeLog | 15 +++++++++++++++ ext/ffmpeg/gstffmpeg.c | 2 +- ext/ffmpeg/gstffmpegcodecmap.c | 4 +++- ext/ffmpeg/gstffmpegdec.c | 10 +++++----- ext/ffmpeg/gstffmpegdemux.c | 9 ++++++--- ext/ffmpeg/gstffmpegprotocol.c | 1 - ext/ffmpeg/gstffmpegscale.c | 3 +-- 7 files changed, 31 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7e3841..953b288 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-04-01 Thomas Vander Stichele + + * ext/ffmpeg/gstffmpeg.c: + * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps): + * ext/ffmpeg/gstffmpegdec.c: + (gst_ffmpegdec_add_pixel_aspect_ratio), (gst_ffmpegdec_frame): + * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_seek): + * ext/ffmpeg/gstffmpegscale.c: (gst_ffmpegscale_transform_caps), + (gst_ffmpegscale_handle_src_event): + various compiler fixes + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_event), + (my_safe_copy), (gst_ffmpegdemux_open), + (gst_ffmpegdemux_change_state): + actually return the result. Tee hee. + 2006-03-31 Thomas Vander Stichele * configure.ac: diff --git a/ext/ffmpeg/gstffmpeg.c b/ext/ffmpeg/gstffmpeg.c index 6c118c2..62732bb 100644 --- a/ext/ffmpeg/gstffmpeg.c +++ b/ext/ffmpeg/gstffmpeg.c @@ -128,6 +128,6 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, "ffmpeg", "All FFMPEG codecs", plugin_init, - GST_FFMPEG_VERSION, "LGPL", "FFMpeg", "http://ffmpeg.sourceforge.net/") + PACKAGE_VERSION, "LGPL", "FFMpeg", "http://ffmpeg.sourceforge.net/") diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index f772000..24d6c8a 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -739,7 +739,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, case CODEC_ID_RA_288: case CODEC_ID_COOK: { - gint version; + gint version = 0; switch (codec_id) { case CODEC_ID_RA_144: version = 1; @@ -750,6 +750,8 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, case CODEC_ID_COOK: version = 8; break; + default: + break; } /* FIXME: properties? */ diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 409db17..e874b62 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -645,8 +645,8 @@ gst_ffmpegdec_add_pixel_aspect_ratio (GstFFMpegDec * ffmpegdec, { gboolean demuxer_par_set = FALSE; gboolean decoder_par_set = FALSE; - gint demuxer_num, demuxer_denom; - gint decoder_num, decoder_denom; + gint demuxer_num = 1, demuxer_denom = 1; + gint decoder_num = 1, decoder_denom = 1; GST_OBJECT_LOCK (ffmpegdec); @@ -965,9 +965,9 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, } else if (ffmpegdec->picture->pict_type != -1 && oclass->in_plugin->capabilities & CODEC_CAP_DELAY) { /* update time for skip-frame */ - if ((!have_data) || - (iskeyframe || !GST_CLOCK_TIME_IS_VALID (ffmpegdec->next_ts)) - && GST_CLOCK_TIME_IS_VALID (*in_ts)) { + if ((have_data == 0) || + ((iskeyframe || !GST_CLOCK_TIME_IS_VALID (ffmpegdec->next_ts)) + && GST_CLOCK_TIME_IS_VALID (*in_ts))) { GST_DEBUG_OBJECT (ffmpegdec, "setting next_ts to *in_ts"); ffmpegdec->next_ts = *in_ts; *in_ts = GST_CLOCK_TIME_NONE; diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index 2fd1d69..28b2c30 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -382,7 +382,6 @@ gst_ffmpegdemux_src_event (GstPad * pad, GstEvent * event) GstFFMpegDemux *demux = (GstFFMpegDemux *) gst_pad_get_parent (pad); AVStream *stream = gst_ffmpegdemux_stream_from_pad (pad); gboolean res = TRUE; - gint64 offset; if (!stream) return FALSE; @@ -680,6 +679,8 @@ my_safe_copy (gchar * input) } else { output = g_strdup (input); } + + return output; } static GstTagList * @@ -810,9 +811,9 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux) /* Send newsegment on all src pads */ for (res = 0; res < demux->context->nb_streams; res++) { - AVStream *stream; - GST_DEBUG_OBJECT (demux, "sending newsegment start:%"GST_TIME_FORMAT" duration:%"GST_TIME_FORMAT, + GST_DEBUG_OBJECT (demux, "sending newsegment start:%" GST_TIME_FORMAT + " duration:%" GST_TIME_FORMAT, GST_TIME_ARGS (demux->segment_start), GST_TIME_ARGS (demux->segment_stop)); @@ -1013,6 +1014,8 @@ gst_ffmpegdemux_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_PAUSED_TO_READY: gst_ffmpegdemux_close (demux); break; + default: + break; } return ret; diff --git a/ext/ffmpeg/gstffmpegprotocol.c b/ext/ffmpeg/gstffmpegprotocol.c index 656d280b..455b35b 100644 --- a/ext/ffmpeg/gstffmpegprotocol.c +++ b/ext/ffmpeg/gstffmpegprotocol.c @@ -167,7 +167,6 @@ gst_ffmpegdata_write (URLContext * h, unsigned char *buf, int size) static offset_t gst_ffmpegdata_seek (URLContext * h, offset_t pos, int whence) { - GstSeekType seek_type = 0; GstProtocolInfo *info; guint64 newpos; diff --git a/ext/ffmpeg/gstffmpegscale.c b/ext/ffmpeg/gstffmpegscale.c index e1866d8..b7974b9 100644 --- a/ext/ffmpeg/gstffmpegscale.c +++ b/ext/ffmpeg/gstffmpegscale.c @@ -161,7 +161,6 @@ static GstCaps * gst_ffmpegscale_transform_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps) { - GstFFMpegScale *scale = GST_FFMPEGSCALE (trans); GstCaps *retcaps; int i; @@ -375,7 +374,7 @@ gst_ffmpegscale_handle_src_event (GstPad * pad, GstEvent * event) event = GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event))); - structure = gst_event_get_structure (event); + structure = (GstStructure *) gst_event_get_structure (event); if (gst_structure_get_double (structure, "pointer_x", &pointer)) { gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, -- 2.7.4