diff --git a/mkvmuxer.cpp b/mkvmuxer.cpp index 604d3f1..0f28315 100644 --- a/mkvmuxer.cpp +++ b/mkvmuxer.cpp @@ -2005,7 +2005,7 @@ bool Segment::AddCuePoint(uint64 timestamp, uint64 track) { return false; cue->set_time(timestamp / segment_info_.timecode_scale()); - cue->set_block_number(cluster->blocks_added() + 1); + cue->set_block_number(cluster->blocks_added()); cue->set_cluster_pos(cluster->position_for_cues()); cue->set_track(track); if (!cues_.AddCue(cue)) diff --git a/mkvmuxer.hpp b/mkvmuxer.hpp index 576556e..1a40b14 100644 --- a/mkvmuxer.hpp +++ b/mkvmuxer.hpp @@ -869,8 +869,9 @@ class Segment { Chapter* AddChapter(); // Adds a cue point to the Cues element. |timestamp| is the time in - // nanoseconds of the cue's time. |track| is the Track of the Cue. Returns - // true on success. + // nanoseconds of the cue's time. |track| is the Track of the Cue. This + // function must be called after AddFrame to calculate the correct + // BlockNumber for the CuePoint. Returns true on success. bool AddCuePoint(uint64 timestamp, uint64 track); // Adds a frame to be output in the file. Returns true on success.