From: <rb...@fr...> - 2004-10-31 15:33:58
|
CVS Root: /home/cvs/gstreamer Module: gst-plugins Changes by: rbultje Date: Sun Oct 31 2004 07:33:55 PST Log message: * ext/ogg/gstoggdemux.c: (gst_ogg_pad_push): Hack to prevent crash when going to READY inside signal handler while this function is active. Modified files: . : ChangeLog ext/ogg : gstoggdemux.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1238&r2=1.1239 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ogg/gstoggdemux.c.diff?r1=1.52&r2=1.53 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1238 retrieving revision 1.1239 diff -u -d -r1.1238 -r1.1239 --- ChangeLog 31 Oct 2004 14:33:17 -0000 1.1238 +++ ChangeLog 31 Oct 2004 15:33:43 -0000 1.1239 @@ -1,5 +1,11 @@ 2004-10-31 Ronald S. Bultje <rb...@ro...> + * ext/ogg/gstoggdemux.c: (gst_ogg_pad_push): + Hack to prevent crash when going to READY inside signal handler + while this function is active. + +2004-10-31 Ronald S. Bultje <rb...@ro...> * gst/ffmpegcolorspace/Makefile.am: * gst/ffmpegcolorspace/avcodec.h: * gst/ffmpegcolorspace/common.h: Index: gstoggdemux.c RCS file: /home/cvs/gstreamer/gst-plugins/ext/ogg/gstoggdemux.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- gstoggdemux.c 29 Oct 2004 16:18:08 -0000 1.52 +++ gstoggdemux.c 31 Oct 2004 15:33:43 -0000 1.53 @@ -562,10 +562,12 @@ GST_OGG_SET_STATE (ogg, GST_OGG_STATE_SEEK); FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, - pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;); + pad->flags |= GST_OGG_PAD_NEEDS_DISCONT; + ); if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) { FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, - pad->flags |= GST_OGG_PAD_NEEDS_FLUSH;); + pad->flags |= GST_OGG_PAD_NEEDS_FLUSH; + ); } GST_DEBUG_OBJECT (ogg, "initiating seeking to format %d, offset %" G_GUINT64_FORMAT, format, @@ -640,7 +642,8 @@ gst_event_unref (event); GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT); break; default: gst_pad_event_default (pad, event); @@ -926,7 +929,8 @@ *end = G_MAXINT64; g_assert (ogg->current_chain >= 0); - FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset);); + FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset); + ); if (ogg->setup_state == SETUP_FIND_LAST_CHAIN) { *end = gst_file_pad_get_length (ogg->sinkpad); @@ -1055,7 +1059,8 @@ } else { endpos = G_MAXINT64; FOR_PAD_IN_CHAIN (ogg, pad, ogg->chains->len - 1, - endpos = MIN (endpos, pad->start_offset);); + endpos = MIN (endpos, pad->start_offset); + ); } if (!ogg->seek_skipped || gst_ogg_demux_position (ogg) >= endpos) { /* have we found the endposition for all streams yet? */ @@ -1416,7 +1421,10 @@ int ret; GstBuffer *buf; - while (TRUE) { + /* Hack. If someone connects to the push (or any related) signal and + * goes to READY, the pad will be destroyed and the next line will + * segfault. This does not work on PLAY -> READY -> PLAY. */ + while (GST_STATE (ogg) >= GST_STATE_PAUSED) { ret = ogg_stream_packetout (&pad->stream, &packet); GST_LOG_OBJECT (ogg, "packetout gave %d", ret); switch (ret) { |