mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
pngdec: Keep the input state in reset()
It's still valid after a flush and we might not get a new one.
This commit is contained in:
parent
ef2cc91eb9
commit
f37fca4e00
1 changed files with 31 additions and 24 deletions
|
@ -417,17 +417,6 @@ gst_pngdec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
|
||||||
return TRUE;
|
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
|
static gboolean
|
||||||
gst_pngdec_libpng_init (GstPngDec * pngdec)
|
gst_pngdec_libpng_init (GstPngDec * pngdec)
|
||||||
{
|
{
|
||||||
|
@ -476,20 +465,10 @@ endinfo_failed:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gst_pngdec_start (GstVideoDecoder * decoder)
|
static void
|
||||||
|
gst_pngdec_libpng_clear (GstPngDec * pngdec)
|
||||||
{
|
{
|
||||||
GstPngDec *pngdec = (GstPngDec *) decoder;
|
|
||||||
|
|
||||||
gst_pngdec_libpng_init (pngdec);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gst_pngdec_stop (GstVideoDecoder * decoder)
|
|
||||||
{
|
|
||||||
GstPngDec *pngdec = (GstPngDec *) decoder;
|
|
||||||
png_infopp info = NULL, endinfo = NULL;
|
png_infopp info = NULL, endinfo = NULL;
|
||||||
|
|
||||||
GST_LOG ("cleaning up libpng structures");
|
GST_LOG ("cleaning up libpng structures");
|
||||||
|
@ -510,6 +489,24 @@ gst_pngdec_stop (GstVideoDecoder * decoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
pngdec->color_type = -1;
|
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) {
|
if (pngdec->input_state) {
|
||||||
gst_video_codec_state_unref (pngdec->input_state);
|
gst_video_codec_state_unref (pngdec->input_state);
|
||||||
|
@ -522,3 +519,13 @@ gst_pngdec_stop (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
return TRUE;
|
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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue