sox.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. diff -Naur /var/tmp/portage/graveman-0.3.12_p5/work/graveman-0.3.12-5/src/sox.c ./src/sox.c
  2. --- a/src/sox.c 2005-05-28 02:37:14.000000000 +0200
  3. +++ b/src/sox.c 2007-01-27 18:22:11.000000000 +0100
  4. @@ -37,7 +37,7 @@
  5. gboolean check_sox()
  6. {
  7. gchar *Lsox = conf_get_string("sox");
  8. - gchar *Lcommandline, *Lerr = NULL;
  9. + gchar *Lcommandline, *Lerr = NULL, *Lstdout = NULL;
  10. gboolean Lstatus;
  11. gint Lexit = 0;
  12. @@ -47,12 +47,22 @@
  13. if (!Lsox || !*Lsox) return FALSE;
  14. Lcommandline = g_strdup_printf("%s -help", conf_get_string("sox"));
  15. - Lstatus = g_spawn_command_line_sync(Lcommandline, NULL, &Lerr, &Lexit, NULL);
  16. + Lstatus = g_spawn_command_line_sync(Lcommandline, &Lstdout, &Lerr, &Lexit, NULL);
  17. g_free(Lcommandline);
  18. - GsupportMp3 = (Lstatus == TRUE && Lerr && ((strstr(Lerr, SOX_MP3))));
  19. - GsupportOgg = (Lstatus == TRUE && Lerr && ((strstr(Lerr, SOX_OGG))));
  20. + /* sox 12.17 outputs -help to stderr */
  21. + if (Lerr && strstr(Lerr, "12.17")) {
  22. + GsupportMp3 = (Lstatus == TRUE && Lerr && ((strstr(Lerr, SOX_MP3))));
  23. + GsupportOgg = (Lstatus == TRUE && Lerr && ((strstr(Lerr, SOX_OGG))));
  24. + }
  25. +
  26. + /* sox 12.18 outputs -help to stdout */
  27. + else {
  28. + GsupportMp3 = (Lstatus == TRUE && Lstdout && ((strstr(Lstdout, SOX_MP3))));
  29. + GsupportOgg = (Lstatus == TRUE && Lstdout && ((strstr(Lstdout, SOX_OGG))));
  30. + }
  31. + g_free(Lstdout);
  32. g_free(Lerr);
  33. return Lstatus;