Mercurial > audlegacy-plugins
comparison src/flacng/plugin.c @ 969:0ee1070d1741 trunk
[svn]
- Properly wait for the flac decoder thread to finish
| author | ertzing |
|---|---|
| date | Fri, 20 Apr 2007 13:29:12 -0700 |
| parents | b6c95e2a14f4 |
| children | b1128efde471 |
comparison
equal
deleted
inserted
replaced
| 968:317a7a8c002d | 969:0ee1070d1741 |
|---|---|
| 65 FLAC__StreamDecoder* main_decoder; | 65 FLAC__StreamDecoder* main_decoder; |
| 66 callback_info* test_info; | 66 callback_info* test_info; |
| 67 callback_info* main_info; | 67 callback_info* main_info; |
| 68 gboolean plugin_initialized = FALSE; | 68 gboolean plugin_initialized = FALSE; |
| 69 gint seek_to = -1; | 69 gint seek_to = -1; |
| 70 static GThread* thread; | 70 static GThread* thread = NULL; |
| 71 GMutex* flac_pl_mutex; | 71 GMutex* flac_pl_mutex; |
| 72 | 72 |
| 73 /* === */ | 73 /* === */ |
| 74 | 74 |
| 75 InputPlugin* get_iplugin_info(void) { | 75 InputPlugin* get_iplugin_info(void) { |
| 588 | 588 |
| 589 _ENTER; | 589 _ENTER; |
| 590 | 590 |
| 591 input->playing = FALSE; | 591 input->playing = FALSE; |
| 592 | 592 |
| 593 if (NULL != thread) { | |
| 594 /* | |
| 595 * Wait for the decoder thread to finish | |
| 596 */ | |
| 597 _DEBUG("Waiting for decoder thread to die..."); | |
| 598 g_thread_join(thread); | |
| 599 thread = NULL; | |
| 600 _DEBUG("Decoder thread has finished"); | |
| 601 } | |
| 602 | |
| 593 _LEAVE; | 603 _LEAVE; |
| 594 } | 604 } |
| 595 | 605 |
| 596 /* --- */ | 606 /* --- */ |
| 597 | 607 |
