summaryrefslogtreecommitdiff
path: root/ext/libpng
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-11-12 10:10:15 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-11-12 10:11:32 +0100
commitf37fca4e002683df7393354a0d51a96abe4c3d38 (patch)
tree233e1bc3ad64a82f1d234eb41402d7ea1f52d362 /ext/libpng
parentef2cc91eb9eb5c61687a32d6225d38befdb52e15 (diff)
downloadgstreamer-plugins-good-f37fca4e002683df7393354a0d51a96abe4c3d38.tar.gz
pngdec: Keep the input state in reset()
It's still valid after a flush and we might not get a new one.
Diffstat (limited to 'ext/libpng')
-rw-r--r--ext/libpng/gstpngdec.c53
1 files changed, 30 insertions, 23 deletions
diff --git a/ext/libpng/gstpngdec.c b/ext/libpng/gstpngdec.c
index d6e53ed80..b03ad8363 100644
--- a/ext/libpng/gstpngdec.c
+++ b/ext/libpng/gstpngdec.c
@@ -417,17 +417,6 @@ gst_pngdec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
return TRUE;
}
-
-/* Clean up the libpng structures */
-static gboolean
-gst_pngdec_reset (GstVideoDecoder * decoder, gboolean hard)
-{
- gst_pngdec_stop (decoder);
- gst_pngdec_start (decoder);
-
- return TRUE;
-}
-
static gboolean
gst_pngdec_libpng_init (GstPngDec * pngdec)
{
@@ -476,20 +465,10 @@ endinfo_failed:
}
}
-static gboolean
-gst_pngdec_start (GstVideoDecoder * decoder)
-{
- GstPngDec *pngdec = (GstPngDec *) decoder;
-
- gst_pngdec_libpng_init (pngdec);
-
- return TRUE;
-}
-static gboolean
-gst_pngdec_stop (GstVideoDecoder * decoder)
+static void
+gst_pngdec_libpng_clear (GstPngDec * pngdec)
{
- GstPngDec *pngdec = (GstPngDec *) decoder;
png_infopp info = NULL, endinfo = NULL;
GST_LOG ("cleaning up libpng structures");
@@ -510,6 +489,24 @@ gst_pngdec_stop (GstVideoDecoder * decoder)
}
pngdec->color_type = -1;
+}
+
+static gboolean
+gst_pngdec_start (GstVideoDecoder * decoder)
+{
+ GstPngDec *pngdec = (GstPngDec *) decoder;
+
+ gst_pngdec_libpng_init (pngdec);
+
+ return TRUE;
+}
+
+static gboolean
+gst_pngdec_stop (GstVideoDecoder * decoder)
+{
+ GstPngDec *pngdec = (GstPngDec *) decoder;
+
+ gst_pngdec_libpng_clear (pngdec);
if (pngdec->input_state) {
gst_video_codec_state_unref (pngdec->input_state);
@@ -522,3 +519,13 @@ gst_pngdec_stop (GstVideoDecoder * decoder)
return TRUE;
}
+
+/* Clean up the libpng structures */
+static gboolean
+gst_pngdec_reset (GstVideoDecoder * decoder, gboolean hard)
+{
+ gst_pngdec_libpng_clear (decoder);
+ gst_pngdec_libpng_init (decoder);
+
+ return TRUE;
+}