Bug 834496 - Use ne_map_track_number_to_index in nestegg_track_seek r=kinetik
authorSteve Workman <sworkman@mozilla.com>
Thu, 24 Jan 2013 17:37:48 -0800
changeset 119815 be8bf489bcb147e3973f027946804d1535ee679d
parent 119814 b50cb394053b8ffb14a997b08f6cd5b95dd02473
child 119816 17306ccdd8d51a654a9db5fd4cb9e9c713070ca5
push id21897
push usersworkman@mozilla.com
push dateFri, 25 Jan 2013 01:41:08 +0000
treeherdermozilla-inbound@be8bf489bcb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs834496
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 834496 - Use ne_map_track_number_to_index in nestegg_track_seek r=kinetik
media/libnestegg/README_MOZILLA
media/libnestegg/src/nestegg.c
--- a/media/libnestegg/README_MOZILLA
+++ b/media/libnestegg/README_MOZILLA
@@ -1,8 +1,8 @@
 The source from this directory was copied from the nestegg
 git repository using the update.sh script.  The only changes
 made were those applied by update.sh and the addition of
 Makefile.in build files for the Mozilla build system.
 
 The nestegg git repository is: git://github.com/kinetiknz/nestegg.git
 
-The git commit ID used was 1b1ecd43d1416aec159e1dd41331289aa144bbc4.
+The git commit ID used was 231bff74be5ccfb3caf111266449e6a431712675.
--- a/media/libnestegg/src/nestegg.c
+++ b/media/libnestegg/src/nestegg.c
@@ -1722,17 +1722,18 @@ nestegg_offset_seek(nestegg * ctx, uint6
 }
 
 int
 nestegg_track_seek(nestegg * ctx, unsigned int track, uint64_t tstamp)
 {
   int r;
   struct cue_point * cue_point;
   struct cue_track_positions * pos;
-  uint64_t seek_pos, tc_scale, t;
+  uint64_t seek_pos, tc_scale, track_number;
+  unsigned int t;
   struct ebml_list_node * node = ctx->segment.cues.cue_point.head;
 
   /* If there are no cues loaded, check for cues element in the seek head
      and load it. */
   if (!node) {
     r = ne_init_cue_points(ctx, -1);
     if (r != 0)
       return -1;
@@ -1751,17 +1752,23 @@ nestegg_track_seek(nestegg * ctx, unsign
 
   node = cue_point->cue_track_positions.head;
 
   seek_pos = 0;
 
   while (node) {
     assert(node->id == ID_CUE_TRACK_POSITIONS);
     pos = node->data;
-    if (ne_get_uint(pos->track, &t) == 0 && t - 1 == track) {
+    if (ne_get_uint(pos->track, &track_number) != 0)
+      return -1;
+
+    if (ne_map_track_number_to_index(ctx, track_number, &t) != 0)
+      return -1;
+
+    if (t == track) {
       if (ne_get_uint(pos->cluster_position, &seek_pos) != 0)
         return -1;
       break;
     }
     node = node->next;
   }
 
   /* Seek and set up parser state for segment-level element (Cluster). */