From 0a30ecba90dbc8008ca0f9c39381f34f516e9190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Thu, 25 Oct 2012 19:10:40 +0400 Subject: [PATCH] directsoundsrc: Fix a number of warnings/errors in directsoundsrc * Don't use deprecated glib mutex functions * Don't declare useless variables * Don't link to non-existing libgstinterfaces Fixes #686871 --- sys/directsound/Makefile.am | 2 +- sys/directsound/gstdirectsoundsrc.c | 15 +++++---------- sys/directsound/gstdirectsoundsrc.h | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/sys/directsound/Makefile.am b/sys/directsound/Makefile.am index bdb48bd0f6..c6b0e54b8c 100644 --- a/sys/directsound/Makefile.am +++ b/sys/directsound/Makefile.am @@ -5,7 +5,7 @@ libgstdirectsoundsrc_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \ $(GST_PLUGINS_BASE_CFLAGS) $(DIRECTX_CFLAGS) libgstdirectsoundsrc_la_LIBADD = $(DIRECTDRAW_LIBS) \ $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \ - -lgstinterfaces-$(GST_API_VERSION) -ldsound + -ldsound libgstdirectsoundsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTX_LDFLAGS) libgstdirectsoundsrc_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/sys/directsound/gstdirectsoundsrc.c b/sys/directsound/gstdirectsoundsrc.c index d7023fefe8..b28b44c603 100644 --- a/sys/directsound/gstdirectsoundsrc.c +++ b/sys/directsound/gstdirectsoundsrc.c @@ -136,7 +136,7 @@ gst_directsound_src_finalize (GObject * object) { GstDirectSoundSrc *dsoundsrc = GST_DIRECTSOUND_SRC (object); - g_mutex_free (dsoundsrc->dsound_lock); + g_mutex_clear (&dsoundsrc->dsound_lock); G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -189,12 +189,9 @@ gst_directsound_src_class_init (GstDirectSoundSrcClass * klass) static GstCaps * gst_directsound_src_getcaps (GstBaseSrc * bsrc, GstCaps * filter) { - GstDirectSoundSrc *dsoundsrc; GstCaps *caps = NULL; GST_DEBUG_OBJECT (bsrc, "get caps"); - dsoundsrc = GST_DIRECTSOUND_SRC (bsrc); - caps = gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD (bsrc))); return caps; @@ -253,7 +250,7 @@ static void gst_directsound_src_init (GstDirectSoundSrc * src) { GST_DEBUG_OBJECT (src, "initializing directsoundsrc"); - src->dsound_lock = g_mutex_new (); + g_mutex_init (&src->dsound_lock); } static gboolean @@ -319,14 +316,13 @@ static gboolean gst_directsound_src_close (GstAudioSrc * asrc) { GstDirectSoundSrc *dsoundsrc; - HRESULT hRes; /* Result for windows functions */ GST_DEBUG_OBJECT (asrc, "closing directsoundsrc"); dsoundsrc = GST_DIRECTSOUND_SRC (asrc); /* Release capture handler */ - hRes = IDirectSoundCapture_Release (dsoundsrc->pDSC); + IDirectSoundCapture_Release (dsoundsrc->pDSC); /* Close library */ FreeLibrary (dsoundsrc->DSoundDLL); @@ -446,17 +442,16 @@ static gboolean gst_directsound_src_unprepare (GstAudioSrc * asrc) { GstDirectSoundSrc *dsoundsrc; - HRESULT hRes; GST_DEBUG_OBJECT (asrc, "unpreparing directsoundsrc"); dsoundsrc = GST_DIRECTSOUND_SRC (asrc); /* Stop capturing */ - hRes = IDirectSoundCaptureBuffer_Stop (dsoundsrc->pDSBSecondary); + IDirectSoundCaptureBuffer_Stop (dsoundsrc->pDSBSecondary); /* Release buffer */ - hRes = IDirectSoundCaptureBuffer_Release (dsoundsrc->pDSBSecondary); + IDirectSoundCaptureBuffer_Release (dsoundsrc->pDSBSecondary); return TRUE; } diff --git a/sys/directsound/gstdirectsoundsrc.h b/sys/directsound/gstdirectsoundsrc.h index 2d164fc810..f155687a95 100644 --- a/sys/directsound/gstdirectsoundsrc.h +++ b/sys/directsound/gstdirectsoundsrc.h @@ -68,8 +68,8 @@ G_BEGIN_DECLS typedef struct _GstDirectSoundSrc GstDirectSoundSrc; typedef struct _GstDirectSoundSrcClass GstDirectSoundSrcClass; -#define GST_DSOUND_LOCK(obj) (g_mutex_lock (obj->dsound_lock)) -#define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (obj->dsound_lock)) +#define GST_DSOUND_LOCK(obj) (g_mutex_lock (&obj->dsound_lock)) +#define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (&obj->dsound_lock)) struct _GstDirectSoundSrc { @@ -96,7 +96,7 @@ struct _GstDirectSoundSrc guint device; #endif - GMutex *dsound_lock; + GMutex dsound_lock; };