From: Benjamin Otte Date: Fri, 9 Apr 2004 18:55:10 +0000 (+0000) Subject: ext/gnomevfs/gstgnomevfssink.c: fix erase signal - if any handler returns false the... X-Git-Tag: 1.19.3~511^2~14391 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50d120f1ba3523439c7aa2125faac8685e7cd8f1;p=platform%2Fupstream%2Fgstreamer.git ext/gnomevfs/gstgnomevfssink.c: fix erase signal - if any handler returns false the file will not be overwritten. If ... Original commit message from CVS: * ext/gnomevfs/gstgnomevfssink.c: (_gst_boolean_allow_overwrite_accumulator), (gst_gnomevfssink_class_init): fix erase signal - if any handler returns false the file will not be overwritten. If no handler is connected, the file will not be overwritten either. renamed signal to "allow-overwrite" * ext/mad/gstid3tag.c: (tag_list_to_id3_tag_foreach): free string when adding it to ID3 failed * ext/vorbis/vorbisdec.c: (vorbis_dec_event): unref event when done * gst/audioconvert/gstaudioconvert.c: (_fixate_caps_to_int): free caps * gst/typefind/gsttypefindfunctions.c: (mpeg_video_stream_type_find): fix invalid read --- diff --git a/ChangeLog b/ChangeLog index 8e0b945..2d17ee2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2004-04-09 Benjamin Otte + + * ext/gnomevfs/gstgnomevfssink.c: + (_gst_boolean_allow_overwrite_accumulator), + (gst_gnomevfssink_class_init): + fix erase signal - if any handler returns false the file will not be + overwritten. If no handler is connected, the file will not be + overwritten either. + renamed signal to "allow-overwrite" + * ext/mad/gstid3tag.c: (tag_list_to_id3_tag_foreach): + free string when adding it to ID3 failed + * ext/vorbis/vorbisdec.c: (vorbis_dec_event): + unref event when done + * gst/audioconvert/gstaudioconvert.c: (_fixate_caps_to_int): + free caps + * gst/typefind/gsttypefindfunctions.c: + (mpeg_video_stream_type_find): + fix invalid read + 2004-04-08 David Schleef * gst/ffmpegcolorspace/gstffmpegcolorspace.c: diff --git a/ext/gnomevfs/gstgnomevfssink.c b/ext/gnomevfs/gstgnomevfssink.c index af30b61..8f74251 100644 --- a/ext/gnomevfs/gstgnomevfssink.c +++ b/ext/gnomevfs/gstgnomevfssink.c @@ -157,18 +157,16 @@ gst_gnomevfssink_base_init (gpointer g_class) } static gboolean -_gst_boolean_did_something_accumulator (GSignalInvocationHint * ihint, +_gst_boolean_allow_overwrite_accumulator (GSignalInvocationHint * ihint, GValue * return_accu, const GValue * handler_return, gpointer dummy) { - gboolean did_something; + gboolean allow_overwrite; - did_something = g_value_get_boolean (handler_return); - if (did_something) { - g_value_set_boolean (return_accu, TRUE); - } + allow_overwrite = g_value_get_boolean (handler_return); + g_value_set_boolean (return_accu, allow_overwrite); - /* always continue emission */ - return TRUE; + /* stop emission if signal doesn't allow overwriting */ + return allow_overwrite; } static void @@ -193,9 +191,9 @@ gst_gnomevfssink_class_init (GstGnomeVFSSinkClass * klass) "GnomeVFSHandle", "Handle for GnomeVFS", G_PARAM_READWRITE)); gst_gnomevfssink_signals[SIGNAL_ERASE_ASK] = - g_signal_new ("erase-ask", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstGnomeVFSSinkClass, erase_ask), - _gst_boolean_did_something_accumulator, NULL, + g_signal_new ("allow-overwrite", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstGnomeVFSSinkClass, erase_ask), + _gst_boolean_allow_overwrite_accumulator, NULL, gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index a9b86e2..f7da654 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -309,6 +309,7 @@ vorbis_dec_event (GstVorbisDec * dec, GstEvent * event) GST_ERROR_OBJECT (dec, "failed to parse data for DISCONT event, not sending any"); } + gst_data_unref (GST_DATA (event)); #ifdef HAVE_VORBIS_SYNTHESIS_RESTART vorbis_synthesis_restart (&dec->vd); #endif diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index d1c9a30..62e4b9d 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -431,19 +431,17 @@ _fixate_caps_to_int (GstCaps ** caps, const gchar * field, gint value) gboolean ret = FALSE; guint i; - try = - gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE, - G_MININT, value - 1, NULL), gst_caps_append (try, - gst_caps_new_simple ("audio/x-raw-float", field, GST_TYPE_INT_RANGE, - G_MININT, value - 1, NULL)); + try = gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE, + G_MININT, value - 1, NULL); + gst_caps_append (try, gst_caps_new_simple ("audio/x-raw-float", field, + GST_TYPE_INT_RANGE, G_MININT, value - 1, NULL)); intersection = gst_caps_intersect (*caps, try); if (!gst_caps_is_empty (intersection)) { gst_caps_free (try); - try = - gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE, - value, G_MAXINT, NULL), gst_caps_append (try, - gst_caps_new_simple ("audio/x-raw-float", field, GST_TYPE_INT_RANGE, - value, G_MAXINT, NULL)); + try = gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE, + value, G_MAXINT, NULL); + gst_caps_append (try, gst_caps_new_simple ("audio/x-raw-float", field, + GST_TYPE_INT_RANGE, value, G_MAXINT, NULL)); gst_caps_free (intersection); intersection = gst_caps_intersect (*caps, try); if (!gst_caps_is_empty (intersection)) { @@ -454,6 +452,7 @@ _fixate_caps_to_int (GstCaps ** caps, const gchar * field, gint value) gst_caps_free (intersection); } } + gst_caps_free (try); for (i = 0; i < gst_caps_get_size (*caps); i++) { GstStructure *structure = gst_caps_get_structure (*caps, i); diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 66756b4..dd9c9b6 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -647,7 +647,7 @@ mpeg_video_stream_type_find (GstTypeFind * tf, gpointer unused) if (skipped > GST_MPEGVID_TYPEFIND_TRY_SYNC) break; - if (size < 4) { + if (size < 5) { data = gst_type_find_peek (tf, skipped, GST_MPEGVID_TYPEFIND_SYNC_SIZE); if (!data) break;