gecko-dev/media/liboggz/bug516847.patch
Matthew Gregan 636b7e873a Bug 516847 - liboggz calculates granulepos incorrectly for duplicate Theora frames. r=chris.double
--HG--
extra : rebase_source : 21a045016d300e77fb234d0cbacbfd3bfd25484b
2009-09-22 12:00:52 +12:00

23 lines
733 B
Diff

diff --git a/media/liboggz/src/liboggz/oggz_auto.c b/media/liboggz/src/liboggz/oggz_auto.c
--- a/media/liboggz/src/liboggz/oggz_auto.c
+++ b/media/liboggz/src/liboggz/oggz_auto.c
@@ -559,17 +559,17 @@ typedef struct {
static ogg_int64_t
auto_calc_theora(ogg_int64_t now, oggz_stream_t *stream, ogg_packet *op) {
long keyframe_no;
int keyframe_shift;
unsigned char first_byte;
auto_calc_theora_info_t *info;
- first_byte = op->packet[0];
+ first_byte = op->bytes == 0 ? 0x40 : op->packet[0];
info = (auto_calc_theora_info_t *)stream->calculate_data;
/* header packet */
if (first_byte & 0x80)
{
if (info == NULL) {
stream->calculate_data = oggz_malloc(sizeof(auto_calc_theora_info_t));