Sort return from subtitles_during to fix all-subtitles display in SubtitlePanel.
authorCarl Hetherington <cth@carlh.net>
Thu, 26 May 2016 15:56:41 +0000 (16:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 26 May 2016 15:56:41 +0000 (16:56 +0100)
src/lib/ffmpeg_subtitle_stream.cc

index 6028d10a9bd8c7db6efc30e52291fdea329ee0e3..d1992f138530d4de25feedde8539af71c1d3d093 100644 (file)
@@ -143,6 +143,13 @@ FFmpegSubtitleStream::text_subtitles_during (ContentTimePeriod period, bool star
        return subtitles_during (period, starting, _text_subtitles);
 }
 
+struct PeriodSorter
+{
+       bool operator() (ContentTimePeriod const & a, ContentTimePeriod const & b) {
+               return a.from < b.from;
+       }
+};
+
 list<ContentTimePeriod>
 FFmpegSubtitleStream::subtitles_during (ContentTimePeriod period, bool starting, PeriodMap const & subs) const
 {
@@ -155,6 +162,8 @@ FFmpegSubtitleStream::subtitles_during (ContentTimePeriod period, bool starting,
                }
        }
 
+       d.sort (PeriodSorter ());
+
        return d;
 }