kill_glib_assertion_spam.diff 750 B

12345678910111213141516171819202122232425262728
  1. diff -Naur wmusic-2.0.0/src/wmusic.c wmusic-2.0.0.patched/src/wmusic.c
  2. --- wmusic-2.0.0/src/wmusic.c 2018-06-22 16:18:18.000000000 -0400
  3. +++ wmusic-2.0.0.patched/src/wmusic.c 2018-09-16 01:15:17.317552343 -0400
  4. @@ -374,6 +374,7 @@
  5. double volume;
  6. double factor;
  7. + if(!player) return;
  8. g_object_get(player, "volume", &volume, NULL);
  9. if (*(int*)data == 1)
  10. @@ -393,6 +394,7 @@
  11. void ChangeVol(int x, int y, DARect rect, void *data)
  12. {
  13. float volume = ((float)x)/38;
  14. + if(!player) return;
  15. g_object_set(player, "volume", volume, NULL);
  16. }
  17. @@ -635,6 +637,7 @@
  18. int volume;
  19. double volume_double;
  20. + if(!player) return;
  21. g_object_get(player, "volume", &volume_double, NULL);
  22. volume = (int)(36 * volume_double);
  23. if (volume > 36)