patch-plugins_flac_flac_c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $OpenBSD: patch-plugins_flac_flac_c,v 1.1 2016/09/13 08:48:12 dcoppa Exp $
  2. commit aa34db82ba64cc5f8d29b5109ddefd2811ca23e5
  3. Author: Alexey Yakovenko <wakeroid@gmail.com>
  4. Date: Mon Aug 8 18:59:29 2016 +0200
  5. flac: change embedded cue load order, to reduce a chance of loading
  6. bad-formed native flac cuesheets
  7. --- plugins/flac/flac.c.orig Sun Jun 19 13:26:18 2016
  8. +++ plugins/flac/flac.c Wed Sep 7 16:40:48 2016
  9. @@ -932,16 +932,6 @@ cflac_insert (ddb_playlist_t *plt, DB_playItem_t *afte
  10. // try embedded cue
  11. deadbeef->pl_lock ();
  12. - if (info.flac_cue_sheet) {
  13. - DB_playItem_t *cue = cflac_insert_with_embedded_cue (plt, after, it, &info.flac_cue_sheet->data.cue_sheet, info.totalsamples, info.info.fmt.samplerate);
  14. - if (cue) {
  15. - cflac_free_temp (_info);
  16. - deadbeef->pl_item_unref (it);
  17. - deadbeef->pl_item_unref (cue);
  18. - deadbeef->pl_unlock ();
  19. - return cue;
  20. - }
  21. - }
  22. const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet");
  23. if (cuesheet) {
  24. DB_playItem_t *last = deadbeef->plt_insert_cue_from_buffer (plt, after, it, (const uint8_t *)cuesheet, strlen (cuesheet), info.totalsamples, info.info.fmt.samplerate);
  25. @@ -951,6 +941,16 @@ cflac_insert (ddb_playlist_t *plt, DB_playItem_t *afte
  26. deadbeef->pl_item_unref (last);
  27. deadbeef->pl_unlock ();
  28. return last;
  29. + }
  30. + }
  31. + if (info.flac_cue_sheet) {
  32. + DB_playItem_t *cue = cflac_insert_with_embedded_cue (plt, after, it, &info.flac_cue_sheet->data.cue_sheet, info.totalsamples, info.info.fmt.samplerate);
  33. + if (cue) {
  34. + cflac_free_temp (_info);
  35. + deadbeef->pl_item_unref (it);
  36. + deadbeef->pl_item_unref (cue);
  37. + deadbeef->pl_unlock ();
  38. + return cue;
  39. }
  40. }
  41. deadbeef->pl_unlock ();