summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2012-10-25 19:10:40 +0400
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-26 10:01:03 +0200
commit0a30ecba90dbc8008ca0f9c39381f34f516e9190 (patch)
tree2bcb1163ac3c4167d2fa0640c1c8d5c4f12503c0
parent0d1c7f6ea28b957c5df560208d88fa5cbb8beac0 (diff)
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
-rw-r--r--sys/directsound/Makefile.am2
-rw-r--r--sys/directsound/gstdirectsoundsrc.c15
-rw-r--r--sys/directsound/gstdirectsoundsrc.h6
3 files changed, 9 insertions, 14 deletions
diff --git a/sys/directsound/Makefile.am b/sys/directsound/Makefile.am
index bdb48bd0f..c6b0e54b8 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 d7023fefe..b28b44c60 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 2d164fc81..f155687a9 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;
};