libwebm: Fix BlockNumber on CuePoint

- libwebm was writing the BlockNumber of the next Block instead
  of the Block that was just written.

Change-Id: I344800fcea919a82d7f0a04a54cf510be3851ec6
This commit is contained in:
Frank Galligan 2012-11-12 08:35:39 -08:00
parent 386928d8b8
commit baefebcf1c
2 changed files with 4 additions and 3 deletions

View File

@ -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))

View File

@ -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.