diff options
Diffstat (limited to 'src/lib/playlist.cc')
| -rw-r--r-- | src/lib/playlist.cc | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index df7c95cc0..80037b575 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -58,10 +58,26 @@ using namespace boost::placeholders; #endif -Playlist::Playlist () +class ContentSorter { +public: + bool operator()(shared_ptr<Content> a, shared_ptr<Content> b) + { + if (a->position() != b->position()) { + return a->position() < b->position(); + } -} + /* Put video before audio if they start at the same time */ + if (a->video && !b->video) { + return true; + } else if (!a->video && b->video) { + return false; + } + + /* Last resort */ + return a->digest() < b->digest(); + } +}; Playlist::~Playlist () @@ -542,25 +558,6 @@ Playlist::set_sequence (bool s) } -bool -ContentSorter::operator() (shared_ptr<Content> a, shared_ptr<Content> b) -{ - if (a->position() != b->position()) { - return a->position() < b->position(); - } - - /* Put video before audio if they start at the same time */ - if (a->video && !b->video) { - return true; - } else if (!a->video && b->video) { - return false; - } - - /* Last resort */ - return a->digest() < b->digest(); -} - - /** @return content in ascending order of position */ ContentList Playlist::content () const |
