From: Wim Taymans Date: Tue, 10 Dec 2002 20:41:06 +0000 (+0000) Subject: Properly reset the internal state without leaking the filehandle X-Git-Tag: 1.19.3~509^2~16130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dff7f0496f2bc5c416c48bc1261203a4fc68cd5a;p=platform%2Fupstream%2Fgstreamer.git Properly reset the internal state without leaking the filehandle Original commit message from CVS: Properly reset the internal state without leaking the filehandle --- diff --git a/sys/oss/gstosscommon.c b/sys/oss/gstosscommon.c index 50128c7..65c8a78 100644 --- a/sys/oss/gstosscommon.c +++ b/sys/oss/gstosscommon.c @@ -105,6 +105,12 @@ gst_osscommon_init (GstOssCommon *common) common->device = g_strdup ("/dev/dsp"); common->fd = -1; + gst_osscommon_reset (common); +} + +void +gst_osscommon_reset (GstOssCommon *common) +{ common->law = 0; common->endianness = G_BYTE_ORDER; common->sign = TRUE; diff --git a/sys/oss/gstosscommon.h b/sys/oss/gstosscommon.h index ab5553f..0c35bd0 100644 --- a/sys/oss/gstosscommon.h +++ b/sys/oss/gstosscommon.h @@ -57,6 +57,7 @@ struct _GstOssCommon }; void gst_osscommon_init (GstOssCommon *common); +void gst_osscommon_reset (GstOssCommon *common); gboolean gst_osscommon_open_audio (GstOssCommon *common, GstOssOpenMode mode, gchar **error); diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c index 2360302..ba86f91 100644 --- a/sys/oss/gstosssink.c +++ b/sys/oss/gstosssink.c @@ -589,7 +589,7 @@ gst_osssink_change_state (GstElement *element) case GST_STATE_PAUSED_TO_READY: if (GST_FLAG_IS_SET (element, GST_OSSSINK_OPEN)) ioctl (osssink->common.fd, SNDCTL_DSP_RESET, 0); - gst_osscommon_init (&osssink->common); + gst_osscommon_reset (&osssink->common); break; case GST_STATE_READY_TO_NULL: if (GST_FLAG_IS_SET (element, GST_OSSSINK_OPEN)) {