From: <en...@ke...> - 2007-11-20 12:20:47
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: ensonic Date: Tue Nov 20 2007 12:20:52 UTC Log message: * ext/libpng/gstpngdec.c: * ext/libpng/gstpngdec.h: Don't release the png-memory from within the callback. Modified files: . : ChangeLog ext/libpng : gstpngdec.c gstpngdec.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3180&r2=1.3181 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ext/libpng/gstpngdec.c.diff?r1=1.35&r2=1.36 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ext/libpng/gstpngdec.h.diff?r1=1.8&r2=1.9 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.3180 retrieving revision 1.3181 diff -u -d -r1.3180 -r1.3181 --- ChangeLog 20 Nov 2007 12:11:12 -0000 1.3180 +++ ChangeLog 20 Nov 2007 12:20:37 -0000 1.3181 @@ -1,5 +1,11 @@ 2007-11-20 Stefan Kost <en...@us...> + * ext/libpng/gstpngdec.c: + * ext/libpng/gstpngdec.h: + Don't release the png-memory from within the callback. + +2007-11-20 Stefan Kost <en...@us...> Patch by: René Stadler <mail at renestadler dot de> * ext/libpng/gstpngenc.c: Index: gstpngdec.c RCS file: /cvs/gstreamer/gst-plugins-good/ext/libpng/gstpngdec.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- gstpngdec.c 20 Jul 2007 07:41:57 -0000 1.35 +++ gstpngdec.c 20 Nov 2007 12:20:38 -0000 1.36 @@ -168,6 +168,8 @@ pngdec->in_duration = GST_CLOCK_TIME_NONE; gst_segment_init (&pngdec->segment, GST_FORMAT_UNDEFINED); + pngdec->image_ready = FALSE; } static void @@ -292,18 +294,7 @@ gst_buffer_unref (pngdec->buffer_out); } pngdec->buffer_out = NULL; - - if (pngdec->framed) { - /* Reset ourselves for the next frame */ - gst_pngdec_libpng_clear (pngdec); - gst_pngdec_libpng_init (pngdec); - GST_LOG_OBJECT (pngdec, "setting up callbacks for next frame"); - png_set_progressive_read_fn (pngdec->png, pngdec, - user_info_callback, user_endrow_callback, user_end_callback); - } else { - GST_LOG_OBJECT (pngdec, "sending EOS"); - pngdec->ret = gst_pad_push_event (pngdec->srcpad, gst_event_new_eos ()); - } + pngdec->image_ready = TRUE; @@ -564,6 +555,21 @@ png_process_data (pngdec->png, pngdec->info, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer)); + if (pngdec->image_ready) { + if (pngdec->framed) { + /* Reset ourselves for the next frame */ + gst_pngdec_libpng_clear (pngdec); + gst_pngdec_libpng_init (pngdec); + GST_LOG_OBJECT (pngdec, "setting up callbacks for next frame"); + png_set_progressive_read_fn (pngdec->png, pngdec, + user_info_callback, user_endrow_callback, user_end_callback); + } else { + GST_LOG_OBJECT (pngdec, "sending EOS"); + pngdec->ret = gst_pad_push_event (pngdec->srcpad, gst_event_new_eos ()); + } + pngdec->image_ready = FALSE; + } /* grab new return code */ ret = pngdec->ret; Index: gstpngdec.h RCS file: /cvs/gstreamer/gst-plugins-good/ext/libpng/gstpngdec.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gstpngdec.h 17 Jul 2006 10:22:54 -0000 1.8 +++ gstpngdec.h 20 Nov 2007 12:20:38 -0000 1.9 @@ -69,6 +69,7 @@ GstClockTime in_duration; GstSegment segment; + gboolean image_ready; }; struct _GstPngDecClass |