Mercurial > hg > segmenter-vamp-plugin
diff songparts/SongParts.cpp @ 39:5875c9d488b7 slimline
Catch bad_alloc (can occur on allocating cube for long song) and reject
author | Chris Cannam |
---|---|
date | Wed, 16 May 2012 12:22:59 +0100 |
parents | 0a1f643b31d9 |
children | bf13b49cd82f |
line wrap: on
line diff
--- a/songparts/SongParts.cpp Wed May 16 12:04:21 2012 +0100 +++ b/songparts/SongParts.cpp Wed May 16 12:22:59 2012 +0100 @@ -783,7 +783,11 @@ masterFeatureset[m_qchromaOutputNumber] = quantisedChroma[1]; // Segmentation - masterFeatureset[m_segmOutputNumber] = runSegmenter(quantisedChroma[1]); + try { + masterFeatureset[m_segmOutputNumber] = runSegmenter(quantisedChroma[1]); + } catch (std::bad_alloc &a) { + cerr << "ERROR: SongPartitioner::getRemainingFeatures: Failed to run segmenter, not enough memory (song too long?)" << endl; + } return(masterFeatureset); }