summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2018-01-22 13:44:29 +0200
committerSebastian Dröge <sebastian@centricular.com>2018-01-22 15:24:56 +0200
commitb691700f5e4f667ba901bfac0c5e13d166656f0d (patch)
treea0bda060bc506cf4a8c743050b6e65b833c4a627
parent1450851095915b6fd558d95a8d0aa4b98c043f3d (diff)
downloadgstreamer-plugins-bad-b691700f5e4f667ba901bfac0c5e13d166656f0d.tar.gz
directsoundsrc: Don't dynamically load one DirectSound symbol at runtime
Just link statically to it, like for all other DirectSound symbols.
-rw-r--r--sys/directsound/gstdirectsoundsrc.c41
-rw-r--r--sys/directsound/gstdirectsoundsrc.h1
2 files changed, 1 insertions, 41 deletions
diff --git a/sys/directsound/gstdirectsoundsrc.c b/sys/directsound/gstdirectsoundsrc.c
index faaa5a22b..0df4f4fc5 100644
--- a/sys/directsound/gstdirectsoundsrc.c
+++ b/sys/directsound/gstdirectsoundsrc.c
@@ -93,9 +93,6 @@ enum
PROP_MUTE
};
-static HRESULT (WINAPI * pDSoundCaptureCreate) (LPGUID,
- LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
-
static void gst_directsound_src_finalize (GObject * object);
static void gst_directsound_src_set_property (GObject * object,
@@ -410,22 +407,6 @@ gst_directsound_src_open (GstAudioSrc * asrc)
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
- /* Open dsound.dll */
- dsoundsrc->DSoundDLL = LoadLibrary ("dsound.dll");
- if (!dsoundsrc->DSoundDLL) {
- goto dsound_open;
- }
-
- /* Building the DLL Calls */
- pDSoundCaptureCreate =
- (void *) GetProcAddress (dsoundsrc->DSoundDLL,
- TEXT ("DirectSoundCaptureCreate"));
-
- /* If everything is not ok */
- if (!pDSoundCaptureCreate) {
- goto capture_function;
- }
-
if (dsoundsrc->device_id) {
GST_DEBUG_OBJECT (asrc, "device id set to: %s ", dsoundsrc->device_id);
dsoundsrc->device_guid = string_to_guid (dsoundsrc->device_id);
@@ -446,7 +427,7 @@ gst_directsound_src_open (GstAudioSrc * asrc)
}
}
/* Create capture object */
- hRes = pDSoundCaptureCreate (dsoundsrc->device_guid, &dsoundsrc->pDSC, NULL);
+ hRes = DirectSoundCaptureCreate (dsoundsrc->device_guid, &dsoundsrc->pDSC, NULL);
if (FAILED (hRes)) {
@@ -459,35 +440,18 @@ gst_directsound_src_open (GstAudioSrc * asrc)
return TRUE;
-capture_function:
- {
- FreeLibrary (dsoundsrc->DSoundDLL);
- GST_ELEMENT_ERROR (dsoundsrc, RESOURCE, OPEN_READ,
- ("Unable to get capturecreate function"), (NULL));
- return FALSE;
- }
capture_enumerate:
{
- FreeLibrary (dsoundsrc->DSoundDLL);
GST_ELEMENT_ERROR (dsoundsrc, RESOURCE, OPEN_READ,
("Unable to enumerate audio capture devices"), (NULL));
return FALSE;
}
capture_object:
{
- FreeLibrary (dsoundsrc->DSoundDLL);
GST_ELEMENT_ERROR (dsoundsrc, RESOURCE, OPEN_READ,
("Unable to create capture object"), (NULL));
return FALSE;
}
-dsound_open:
- {
- DWORD err = GetLastError ();
- GST_ELEMENT_ERROR (dsoundsrc, RESOURCE, OPEN_READ,
- ("Unable to open dsound.dll"), (NULL));
- g_print ("0x%lx\n", HRESULT_FROM_WIN32 (err));
- return FALSE;
- }
}
static gboolean
@@ -502,9 +466,6 @@ gst_directsound_src_close (GstAudioSrc * asrc)
/* Release capture handler */
IDirectSoundCapture_Release (dsoundsrc->pDSC);
- /* Close library */
- FreeLibrary (dsoundsrc->DSoundDLL);
-
if (dsoundsrc->mixer)
mixerClose (dsoundsrc->mixer);
diff --git a/sys/directsound/gstdirectsoundsrc.h b/sys/directsound/gstdirectsoundsrc.h
index 384c801c7..bffb77256 100644
--- a/sys/directsound/gstdirectsoundsrc.h
+++ b/sys/directsound/gstdirectsoundsrc.h
@@ -77,7 +77,6 @@ struct _GstDirectSoundSrc
GstAudioSrc src;
- HINSTANCE DSoundDLL; /* DLL instance */
LPDIRECTSOUNDCAPTURE pDSC; /* DirectSoundCapture*/
LPDIRECTSOUNDCAPTUREBUFFER pDSBSecondary; /*Secondaty capturebuffer*/
DWORD current_circular_offset;