~siretart/gxine/trusty

« back to all changes in this revision

Viewing changes to src/lirc.c

  • Committer: Reinhard Tartler
  • Date: 2014-04-12 20:42:35 UTC
  • mfrom: (2.1.17 sid)
  • Revision ID: siretart@tauware.de-20140412204235-6q61vzswh4lc2nrk
* Ack NMU. (Closes: #665555)
* Add debian/README.source, noting that single-patch format is chosen (and
  enforced in the package repository).
* Add input support for xineliboutput (from upstream).
* Non-maintainer upload.
* debian/patches:
  - glib.patch: Fix building with newer glib. Thanks to Micheal Biebl for
    the patch. (Closes: #665555)
  - underlinkage.patch: Link with -ldl and -lm to fix unresolved symbols.
* debian/control: Replace libmozjs-dev with libmozjs185-dev since gxine
  doesn't build with libmozjs-dev from iceweasel 17.
* Switched source maintenance to mercurial-buildpackage.
* Change of address.
* Bump standards version to 3.9.3.
* New upstream release.
  - Fixes FTBFS with Iceweasel 10's mozjs. (Closes: #660661)
* Recommend libxine2-ffmpeg, not libxine1-ffmpeg.
* Bumped standards version to 3.9.2.
* Switch to xine-lib-1.2. Build dependencies adjusted accordingly.
* Invoke a trigger on /usr/share/applications after updating gxine.desktop.
* Patches from upstream:
  - HAL-related build failure fix. Should fix FTBFS on hurd-i386.
* Patches from upstream:
  - Fix compilation which xulrunner 9 (the JS bit) broke. (Closes: #654277)
  - Fix a missing-playlist crash.
* New upstream release.
  - Buildable against current libmozjs. (Closes: #634417, #631038)
* Add dependency on libxine1-gnome, working around a xine-lib problem by
  using gtkpixbuf for the static logo display. (Closes: #597289)
* Fix a missing "break" statement which caused SPU buttons (typically
  found in DVD navigation menus) to cause spurious playlist items.
  (Closes: #590016)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
#ifdef HAVE_LIRC
46
46
static pthread_t             gxine_lirc_thread;
 
47
static int                   gxine_lirc_thread_created = 0;
47
48
static pthread_mutex_t       lirc_init_mutex = PTHREAD_MUTEX_INITIALIZER;
48
49
static pthread_cond_t        lirc_init_cond = PTHREAD_COND_INITIALIZER;
49
50
static struct lirc_config   *lircconfig;
123
124
      g_printerr (_("lirc: cannot initialise - disabling remote control\n"
124
125
                 "lirc: maybe lircd isn't running or you can't connect to the socket?\n"));
125
126
      failed:
126
 
      gxine_lirc_thread = 0;
 
127
      gxine_lirc_thread_created = 0;
127
128
      pthread_cond_signal (&lirc_init_cond);
128
129
      pthread_mutex_unlock (&lirc_init_mutex);
129
130
      pthread_exit(NULL);
186
187
static void gxine_lirc_start (void)
187
188
{
188
189
  pthread_attr_t attr;
189
 
  gxine_lirc_thread = 0;
 
190
  gxine_lirc_thread_created = 0;
190
191
  pthread_mutex_lock (&lirc_init_mutex);
191
192
  pthread_attr_init (&attr);
192
193
  pthread_attr_setstacksize (&attr, 256 * 1024); /* probably overkill */
193
 
  if (!pthread_create (&gxine_lirc_thread, &attr, gxine_lirc_run, NULL))
 
194
  if (!pthread_create (&gxine_lirc_thread, &attr, gxine_lirc_run, NULL)) {
 
195
    gxine_lirc_thread_created = 1;
194
196
    pthread_cond_wait (&lirc_init_cond, &lirc_init_mutex);
 
197
  }
195
198
  pthread_attr_destroy (&attr);
196
199
  pthread_mutex_unlock (&lirc_init_mutex);
197
200
}
198
201
 
199
202
#else
200
 
#define gxine_lirc_thread (0)
201
 
#define gxine_lirc_start()
 
203
#define gxine_lirc_thread_created (0)
202
204
#endif
203
205
 
204
206
void gxine_lirc_quit (void)
205
207
{
206
208
#ifdef HAVE_LIRC
207
 
  if (gxine_lirc_thread)
 
209
  if (gxine_lirc_thread_created)
208
210
  {
209
211
    pthread_cancel (gxine_lirc_thread);
210
212
    lirc_freeconfig (lircconfig);
216
218
{
217
219
  se_log_fncall ("reload_lirc");
218
220
  se_argc_check_max (0, "reload_lirc");
 
221
#ifdef HAVE_LIRC
219
222
  gxine_lirc_quit ();
220
 
  if (gxine_lirc_thread)
 
223
  if (gxine_lirc_thread_created)
221
224
    pthread_join (gxine_lirc_thread, NULL);
222
225
  gxine_lirc_start ();
 
226
#endif
223
227
  JS_SET_RVAL (cx, vp, gxine_lirc_thread ? JSVAL_TRUE : JSVAL_FALSE);
224
228
  return JS_TRUE;
225
229
}
228
232
{
229
233
  se_defun (gse, NULL, "reload_lirc", js_reload_lirc, 0, JSFUN_FAST_NATIVE,
230
234
            SE_GROUP_HIDDEN, NULL, NULL);
 
235
#ifdef HAVE_LIRC
231
236
  gxine_lirc_start ();
 
237
#endif
232
238
}