diff options
Diffstat (limited to 'src/VideoPlayer.cpp')
-rw-r--r-- | src/VideoPlayer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 4642855..5369a07 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -47,7 +47,11 @@ namespace QuickMedia { static const int MAX_RETRIES_CONNECT = 1000; static const double READ_TIMEOUT_SEC = 3.0; - static std::string media_chapters_to_ffmetadata_chapters(const std::vector<MediaChapter> &chapters) { + static std::string media_chapters_to_ffmetadata_chapters(std::vector<MediaChapter> chapters) { + std::sort(chapters.begin(), chapters.end(), [](const MediaChapter &a, const MediaChapter &b) { + return a.start_seconds < b.start_seconds; + }); + std::string result = ";FFMETADATA1\n\n"; for(size_t i = 0; i < chapters.size(); ++i) { const MediaChapter &chapter = chapters[i]; |