mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +00:00
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
This commit is contained in:
parent
92fe387eea
commit
50d120f1ba
5 changed files with 39 additions and 22 deletions
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
||||||
|
2004-04-09 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* 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 <ds@schleef.org>
|
2004-04-08 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
|
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
|
||||||
|
|
|
@ -157,18 +157,16 @@ gst_gnomevfssink_base_init (gpointer g_class)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
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)
|
GValue * return_accu, const GValue * handler_return, gpointer dummy)
|
||||||
{
|
{
|
||||||
gboolean did_something;
|
gboolean allow_overwrite;
|
||||||
|
|
||||||
did_something = g_value_get_boolean (handler_return);
|
allow_overwrite = g_value_get_boolean (handler_return);
|
||||||
if (did_something) {
|
g_value_set_boolean (return_accu, allow_overwrite);
|
||||||
g_value_set_boolean (return_accu, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* always continue emission */
|
/* stop emission if signal doesn't allow overwriting */
|
||||||
return TRUE;
|
return allow_overwrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -193,9 +191,9 @@ gst_gnomevfssink_class_init (GstGnomeVFSSinkClass * klass)
|
||||||
"GnomeVFSHandle", "Handle for GnomeVFS", G_PARAM_READWRITE));
|
"GnomeVFSHandle", "Handle for GnomeVFS", G_PARAM_READWRITE));
|
||||||
|
|
||||||
gst_gnomevfssink_signals[SIGNAL_ERASE_ASK] =
|
gst_gnomevfssink_signals[SIGNAL_ERASE_ASK] =
|
||||||
g_signal_new ("erase-ask", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
g_signal_new ("allow-overwrite", G_TYPE_FROM_CLASS (klass),
|
||||||
G_STRUCT_OFFSET (GstGnomeVFSSinkClass, erase_ask),
|
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstGnomeVFSSinkClass, erase_ask),
|
||||||
_gst_boolean_did_something_accumulator, NULL,
|
_gst_boolean_allow_overwrite_accumulator, NULL,
|
||||||
gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
|
gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -309,6 +309,7 @@ vorbis_dec_event (GstVorbisDec * dec, GstEvent * event)
|
||||||
GST_ERROR_OBJECT (dec,
|
GST_ERROR_OBJECT (dec,
|
||||||
"failed to parse data for DISCONT event, not sending any");
|
"failed to parse data for DISCONT event, not sending any");
|
||||||
}
|
}
|
||||||
|
gst_data_unref (GST_DATA (event));
|
||||||
#ifdef HAVE_VORBIS_SYNTHESIS_RESTART
|
#ifdef HAVE_VORBIS_SYNTHESIS_RESTART
|
||||||
vorbis_synthesis_restart (&dec->vd);
|
vorbis_synthesis_restart (&dec->vd);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -431,19 +431,17 @@ _fixate_caps_to_int (GstCaps ** caps, const gchar * field, gint value)
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
try =
|
try = gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE,
|
||||||
gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE,
|
G_MININT, value - 1, NULL);
|
||||||
G_MININT, value - 1, NULL), gst_caps_append (try,
|
gst_caps_append (try, gst_caps_new_simple ("audio/x-raw-float", field,
|
||||||
gst_caps_new_simple ("audio/x-raw-float", field, GST_TYPE_INT_RANGE,
|
GST_TYPE_INT_RANGE, G_MININT, value - 1, NULL));
|
||||||
G_MININT, value - 1, NULL));
|
|
||||||
intersection = gst_caps_intersect (*caps, try);
|
intersection = gst_caps_intersect (*caps, try);
|
||||||
if (!gst_caps_is_empty (intersection)) {
|
if (!gst_caps_is_empty (intersection)) {
|
||||||
gst_caps_free (try);
|
gst_caps_free (try);
|
||||||
try =
|
try = gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE,
|
||||||
gst_caps_new_simple ("audio/x-raw-int", field, GST_TYPE_INT_RANGE,
|
value, G_MAXINT, NULL);
|
||||||
value, G_MAXINT, NULL), gst_caps_append (try,
|
gst_caps_append (try, gst_caps_new_simple ("audio/x-raw-float", field,
|
||||||
gst_caps_new_simple ("audio/x-raw-float", field, GST_TYPE_INT_RANGE,
|
GST_TYPE_INT_RANGE, value, G_MAXINT, NULL));
|
||||||
value, G_MAXINT, NULL));
|
|
||||||
gst_caps_free (intersection);
|
gst_caps_free (intersection);
|
||||||
intersection = gst_caps_intersect (*caps, try);
|
intersection = gst_caps_intersect (*caps, try);
|
||||||
if (!gst_caps_is_empty (intersection)) {
|
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 (intersection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gst_caps_free (try);
|
||||||
for (i = 0; i < gst_caps_get_size (*caps); i++) {
|
for (i = 0; i < gst_caps_get_size (*caps); i++) {
|
||||||
GstStructure *structure = gst_caps_get_structure (*caps, i);
|
GstStructure *structure = gst_caps_get_structure (*caps, i);
|
||||||
|
|
||||||
|
|
|
@ -647,7 +647,7 @@ mpeg_video_stream_type_find (GstTypeFind * tf, gpointer unused)
|
||||||
if (skipped > GST_MPEGVID_TYPEFIND_TRY_SYNC)
|
if (skipped > GST_MPEGVID_TYPEFIND_TRY_SYNC)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (size < 4) {
|
if (size < 5) {
|
||||||
data = gst_type_find_peek (tf, skipped, GST_MPEGVID_TYPEFIND_SYNC_SIZE);
|
data = gst_type_find_peek (tf, skipped, GST_MPEGVID_TYPEFIND_SYNC_SIZE);
|
||||||
if (!data)
|
if (!data)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue