From 923440b16ba40a0935a919788ff044cb6c86aaa1 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 18 Jun 2018 19:06:16 -0700 Subject: [PATCH] Only include OpenMPT subsongs if they're 10 seconds or longer. --- Plugins/OpenMPT/OpenMPT/OMPTContainer.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Plugins/OpenMPT/OpenMPT/OMPTContainer.mm b/Plugins/OpenMPT/OpenMPT/OMPTContainer.mm index 77454169f..57946bfb6 100755 --- a/Plugins/OpenMPT/OpenMPT/OMPTContainer.mm +++ b/Plugins/OpenMPT/OpenMPT/OMPTContainer.mm @@ -63,12 +63,14 @@ int i; int subsongs = mod->get_num_subsongs(); - delete mod; - for (i = 0; i < subsongs; ++i) { + mod->select_subsong(i); + if (mod->get_duration_seconds() < 10.0) continue; [tracks addObject:[NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:@"#%i", i]]]; } + delete mod; + return tracks; } catch ( std::exception & /*e*/ ) { return 0;