diff options
author | Michael Smith <msmith@xiph.org> | 2008-08-13 21:58:08 +0000 |
---|---|---|
committer | Michael Smith <msmith@xiph.org> | 2008-08-13 21:58:08 +0000 |
commit | cbc51271903c1e88b142b7d8de4e3fb558009fcc (patch) | |
tree | c03bd80cc8e5ed09e47ada4ae7d88a3373be5679 /sys/dshowdecwrapper/gstdshowaudiodec.c | |
parent | 85b99b9077b0c3f57cd6dac0c00123ac9d487791 (diff) | |
download | gst-plugins-bad-cbc51271903c1e88b142b7d8de4e3fb558009fcc.tar.gz gst-plugins-bad-cbc51271903c1e88b142b7d8de4e3fb558009fcc.tar.bz2 gst-plugins-bad-cbc51271903c1e88b142b7d8de4e3fb558009fcc.zip |
sys/: Initialise COM with default flags.
Original commit message from CVS:
* sys/dshowdecwrapper/gstdshowaudiodec.c:
* sys/dshowdecwrapper/gstdshowaudiodec.h:
* sys/dshowdecwrapper/gstdshowvideodec.c:
* sys/dshowdecwrapper/gstdshowvideodec.h:
* sys/dshowvideosink/dshowvideosink.cpp:
* sys/dshowvideosink/dshowvideosink.h:
Initialise COM with default flags.
Only deinitialise if the initialisation was successful.
Diffstat (limited to 'sys/dshowdecwrapper/gstdshowaudiodec.c')
-rw-r--r-- | sys/dshowdecwrapper/gstdshowaudiodec.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dshowdecwrapper/gstdshowaudiodec.c b/sys/dshowdecwrapper/gstdshowaudiodec.c index d5b5d7fd..e436beb8 100644 --- a/sys/dshowdecwrapper/gstdshowaudiodec.c +++ b/sys/dshowdecwrapper/gstdshowaudiodec.c @@ -275,6 +275,7 @@ gst_dshowaudiodec_init (GstDshowAudioDec * adec, GstDshowAudioDecClass * adec_class) { GstElementClass *element_class = GST_ELEMENT_GET_CLASS (adec); + HRESULT hr; /* setup pads */ adec->sinkpad = @@ -310,7 +311,10 @@ gst_dshowaudiodec_init (GstDshowAudioDec * adec, adec->last_ret = GST_FLOW_OK; - CoInitializeEx (NULL, COINIT_MULTITHREADED); + hr = CoInitialize (0); + if (SUCCEEDED (hr)) { + adec->comInitialized = TRUE; + } } static void @@ -328,7 +332,10 @@ gst_dshowaudiodec_dispose (GObject * object) adec->codec_data = NULL; } - CoUninitialize (); + if (adec->comInitialized) { + CoUninitialize (); + adec->comInitialized = FALSE; + } G_OBJECT_CLASS (parent_class)->dispose (object); } @@ -1141,11 +1148,12 @@ dshow_adec_register (GstPlugin * plugin) (GInstanceInitFunc) gst_dshowaudiodec_init, }; gint i; + HRESULT hr; GST_DEBUG_CATEGORY_INIT (dshowaudiodec_debug, "dshowaudiodec", 0, "Directshow filter audio decoder"); - CoInitializeEx (NULL, COINIT_MULTITHREADED); + hr = CoInitialize (0); for (i = 0; i < sizeof (audio_dec_codecs) / sizeof (CodecEntry); i++) { GType type; @@ -1175,6 +1183,8 @@ dshow_adec_register (GstPlugin * plugin) } } - CoUninitialize (); + if (SUCCEEDED (hr)) + CoUninitialize (); + return TRUE; } |