From: Wim T. <wt...@us...> - 2002-12-10 20:41:28
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: wtay Date: Tue Dec 10 2002 12:41:26 PST Log message: Properly reset the internal state without leaking the filehandle Modified files: sys/oss : gstosscommon.c gstosscommon.h gstosssink.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/oss/gstosscommon.c.diff?r1=1.2&r2=1.3 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/oss/gstosscommon.h.diff?r1=1.2&r2=1.3 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/oss/gstosssink.c.diff?r1=1.47&r2=1.48 ====Begin Diffs==== Index: gstosscommon.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/sys/oss/gstosscommon.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gstosscommon.c 7 Dec 2002 20:54:47 -0000 1.2 +++ gstosscommon.c 10 Dec 2002 20:41:04 -0000 1.3 @@ -105,6 +105,12 @@ 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; Index: gstosscommon.h =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/sys/oss/gstosscommon.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gstosscommon.h 7 Dec 2002 20:54:47 -0000 1.2 +++ gstosscommon.h 10 Dec 2002 20:41:05 -0000 1.3 @@ -57,6 +57,7 @@ }; void gst_osscommon_init (GstOssCommon *common); +void gst_osscommon_reset (GstOssCommon *common); gboolean gst_osscommon_open_audio (GstOssCommon *common, GstOssOpenMode mode, gchar **error); Index: gstosssink.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/sys/oss/gstosssink.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- gstosssink.c 7 Dec 2002 20:54:47 -0000 1.47 +++ gstosssink.c 10 Dec 2002 20:41:06 -0000 1.48 @@ -589,7 +589,7 @@ 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)) { |