mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 846122 - Handle split multi-track Cues in nestegg. r=padenot
This commit is contained in:
parent
0068a648e9
commit
df6b4497ba
@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
|
|||||||
|
|
||||||
The nestegg git repository is: git://github.com/kinetiknz/nestegg.git
|
The nestegg git repository is: git://github.com/kinetiknz/nestegg.git
|
||||||
|
|
||||||
The git commit ID used was ebdbb688fb13dd315fc9d16e6897adb5ee42b7bb.
|
The git commit ID used was 443edc8d8cb1037275b055474256a7fa089766dc.
|
||||||
|
@ -1407,10 +1407,14 @@ ne_find_seek_for_id(struct ebml_list_node * seek_head, uint64_t id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct cue_point *
|
static struct cue_point *
|
||||||
ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale, uint64_t tstamp)
|
ne_find_cue_point_for_tstamp(nestegg * ctx, struct ebml_list_node * cue_point, unsigned int track, uint64_t scale, uint64_t tstamp)
|
||||||
{
|
{
|
||||||
uint64_t time;
|
uint64_t time;
|
||||||
struct cue_point * c, * prev = NULL;
|
struct cue_point * c, * prev = NULL;
|
||||||
|
uint64_t track_number;
|
||||||
|
unsigned int t;
|
||||||
|
struct ebml_list_node * node;
|
||||||
|
struct cue_track_positions * pos;
|
||||||
|
|
||||||
while (cue_point) {
|
while (cue_point) {
|
||||||
assert(cue_point->id == ID_CUE_POINT);
|
assert(cue_point->id == ID_CUE_POINT);
|
||||||
@ -1419,14 +1423,27 @@ ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale,
|
|||||||
if (!prev)
|
if (!prev)
|
||||||
prev = c;
|
prev = c;
|
||||||
|
|
||||||
if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp)
|
node = prev->cue_track_positions.head;
|
||||||
break;
|
while (node) {
|
||||||
|
assert(node->id == ID_CUE_TRACK_POSITIONS);
|
||||||
|
pos = node->data;
|
||||||
|
if (ne_get_uint(pos->track, &track_number) != 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (ne_map_track_number_to_index(ctx, track_number, &t) != 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp && t == track)
|
||||||
|
return prev;
|
||||||
|
|
||||||
|
node = node->next;
|
||||||
|
}
|
||||||
|
|
||||||
prev = cue_point->data;
|
prev = cue_point->data;
|
||||||
cue_point = cue_point->next;
|
cue_point = cue_point->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return prev;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1850,7 +1867,7 @@ nestegg_track_seek(nestegg * ctx, unsigned int track, uint64_t tstamp)
|
|||||||
|
|
||||||
tc_scale = ne_get_timecode_scale(ctx);
|
tc_scale = ne_get_timecode_scale(ctx);
|
||||||
|
|
||||||
cue_point = ne_find_cue_point_for_tstamp(ctx->segment.cues.cue_point.head, tc_scale, tstamp);
|
cue_point = ne_find_cue_point_for_tstamp(ctx, ctx->segment.cues.cue_point.head, track, tc_scale, tstamp);
|
||||||
if (!cue_point)
|
if (!cue_point)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user