Skip to content

Commit

Permalink
Bug 1064705 - Don't treat EOS as fatal when reading optional block su…
Browse files Browse the repository at this point in the history
…belements in nestegg_read_packet. r=cajbir
  • Loading branch information
kinetiknz committed Sep 9, 2014
1 parent 31904dc commit 394683a
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 21 deletions.
5 changes: 3 additions & 2 deletions content/media/mediasource/test/test_MediaSource.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@
});

v.addEventListener("ended", function () {
is(v.duration, 4, "Video has correct duration");
is(v.currentTime, 4, "Video has played to end");
// XXX: Duration should be exactly 4.0, see bug 1065207.
ok(Math.abs(v.duration - 4) <= 0.002, "Video has correct duration");
ok(Math.abs(v.currentTime - 4) <= 0.002, "Video has played to end");
is(updateCount, 1, "update event received");
is(updateendCount, 1, "updateend event received");
is(updatestartCount, 1, "updatestart event received");
Expand Down
5 changes: 3 additions & 2 deletions content/media/mediasource/test/test_SplitAppend.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
});

v.addEventListener("ended", function () {
is(v.duration, 4, "Video has correct duration");
is(v.currentTime, 4, "Video has played to end");
// XXX: Duration should be exactly 4.0, see bug 1065207.
ok(Math.abs(v.duration - 4) <= 0.002, "Video has correct duration");
ok(Math.abs(v.currentTime - 4) <= 0.002, "Video has played to end");
SimpleTest.finish();
});
});
Expand Down
5 changes: 3 additions & 2 deletions content/media/mediasource/test/test_SplitAppendDelay.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
});

v.addEventListener("ended", function () {
is(v.duration, 4, "Video has correct duration");
is(v.currentTime, 4, "Video has played to end");
// XXX: Duration should be exactly 4.0, see bug 1065207.
ok(Math.abs(v.duration - 4) <= 0.002, "Video has correct duration");
ok(Math.abs(v.currentTime - 4) <= 0.002, "Video has played to end");
SimpleTest.finish();
});
});
Expand Down
2 changes: 1 addition & 1 deletion media/libnestegg/README_MOZILLA
Original file line number Diff line number Diff line change
Expand Up @@ -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 git commit ID used was 276ccd80e723b0edaf0ef42dbacb5a3a42e02d5c.
The git commit ID used was 46ab96bcc8b099704cc8a15993f80fe0269a5284.
14 changes: 14 additions & 0 deletions media/libnestegg/include/nestegg.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ typedef struct {
unsigned int crop_top; /**< Pixels to crop from the top of the frame. */
unsigned int crop_left; /**< Pixels to crop from the left of the frame. */
unsigned int crop_right; /**< Pixels to crop from the right of the frame. */
unsigned int alpha_mode; /**< 1 if an additional opacity stream is available, otherwise 0. */
} nestegg_video_params;

/** Parameters specific to an audio track. */
Expand Down Expand Up @@ -340,6 +341,19 @@ int nestegg_packet_count(nestegg_packet * packet, unsigned int * count);
int nestegg_packet_data(nestegg_packet * packet, unsigned int item,
unsigned char ** data, size_t * length);

/** Get a pointer to additional data with identifier @a id of additional packet
data. If @a id isn't present in the packet, returns -1.
@param packet Packet initialized by #nestegg_read_packet.
@param id Codec specific identifer. For VP8, use 1 to get a VP8 encoded
frame containing an alpha channel in its Y plane.
@param data Storage for the queried data pointer.
The data is owned by the #nestegg_packet packet.
@param length Storage for the queried data size.
@retval 0 Success.
@retval -1 Error. */
int nestegg_packet_additional_data(nestegg_packet * packet, unsigned int id,
unsigned char ** data, size_t * length);

/** Returns discard_padding for given packet
@param packet Packet initialized by #nestegg_read_packet.
@param discard_padding pointer to store discard padding in.
Expand Down
Loading

0 comments on commit 394683a

Please sign in to comment.