diff options
author | wm4 <wm4@nowhere> | 2013-04-12 13:20:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-12 14:38:04 +0200 |
commit | 6f28c061b4a87b2dbd9d0c5553b7b5f6a83b9c3e (patch) | |
tree | f087010385ec5076b2efab98de88c3c93d60d8f1 /demux/demux.h | |
parent | a5916f5d1df7ad9c3e9d2644f930a3e62c4c0d3c (diff) | |
download | mpv-6f28c061b4a87b2dbd9d0c5553b7b5f6a83b9c3e.tar.bz2 mpv-6f28c061b4a87b2dbd9d0c5553b7b5f6a83b9c3e.tar.xz |
demux: always sort chapters
The condition that checked whether the chapters are out of order and
should be sorted was inverted. This likely wasn't noticed in testing,
because even if the chapters are unsorted, if the last two chapters
were sorted, the rest got sorted too.
Instead of doing this silly check, always sort the chapters after
demuxer initialization. Also make sure the sort order is stable in case
chapter start times are the same (original_index check).
Diffstat (limited to 'demux/demux.h')
-rw-r--r-- | demux/demux.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/demux/demux.h b/demux/demux.h index debd0f55b1..c922dc8bb5 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -183,6 +183,7 @@ typedef struct demuxer_desc { typedef struct demux_chapter { + int original_index; uint64_t start, end; char *name; } demux_chapter_t; @@ -394,6 +395,7 @@ int demuxer_add_chapter(struct demuxer *demuxer, struct bstr name, uint64_t start, uint64_t end); int demuxer_seek_chapter(struct demuxer *demuxer, int chapter, double *seek_pts); +void demuxer_sort_chapters(demuxer_t *demuxer); /// Get current chapter index if available. int demuxer_get_current_chapter(struct demuxer *demuxer, double time_now); |