Skip to content

Commit

Permalink
libmatroska2: Improve MATROSKA_CuePosInSegment
Browse files Browse the repository at this point in the history
This function seems to have been copied and pasted from
MATROSKA_CueTimeCode, with only minimal modifications performed to make
it do what its name suggest. This means that a variable that never
stores a time is called TimeCode and that the function returns
INVALID_TIMECODE_T instead of INVALID_FILEPOS_T. These things have been
changed.

Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Jan 30, 2019
1 parent 3079e62 commit 374b3c9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libmatroska2/matroskamain.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,15 +739,15 @@ timecode_t MATROSKA_CueTimecode(const matroska_cuepoint *Cue)

filepos_t MATROSKA_CuePosInSegment(const matroska_cuepoint *Cue)
{
ebml_element *TimeCode;
ebml_element *ClusterPosition;
assert(EBML_ElementIsType((ebml_element*)Cue, &MATROSKA_ContextCuePoint));
TimeCode = EBML_MasterFindChild((ebml_master*)Cue,&MATROSKA_ContextCueTrackPositions);
if (!TimeCode)
return INVALID_TIMECODE_T;
TimeCode = EBML_MasterFindChild((ebml_master*)TimeCode,&MATROSKA_ContextCueClusterPosition);
if (!TimeCode)
return INVALID_TIMECODE_T;
return EBML_IntegerValue((ebml_integer*)TimeCode);
ClusterPosition = EBML_MasterFindChild((ebml_master*)Cue,&MATROSKA_ContextCueTrackPositions);
if (!ClusterPosition)
return INVALID_FILEPOS_T;
ClusterPosition = EBML_MasterFindChild((ebml_master*)ClusterPosition,&MATROSKA_ContextCueClusterPosition);
if (!ClusterPosition)
return INVALID_FILEPOS_T;
return EBML_IntegerValue((ebml_integer*)ClusterPosition);
}

err_t MATROSKA_CuePointUpdate(matroska_cuepoint *Cue, ebml_element *Segment)
Expand Down

0 comments on commit 374b3c9

Please sign in to comment.