Commit 2b657aa5 authored by conrad's avatar conrad

fix theora keyframe shift in oggz_auto (was using old alpha3 method)


git-svn-id: http://svn.annodex.net/liboggz/trunk@570 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent aac0ae6b
...@@ -128,6 +128,11 @@ auto_theora_metric (OGGZ * oggz, long serialno, ogg_int64_t granulepos, ...@@ -128,6 +128,11 @@ auto_theora_metric (OGGZ * oggz, long serialno, ogg_int64_t granulepos,
units = OGGZ_AUTO_MULT * granulepos * tdata->fps_denominator / units = OGGZ_AUTO_MULT * granulepos * tdata->fps_denominator /
tdata->fps_numerator; tdata->fps_numerator;
#ifdef DEBUG
printf ("serialno %010ld: Got theora frame %lld (%lld + %lld)\n",
serialno, granulepos, iframe, pframe, tdata->keyframe_shift);
#endif
return units; return units;
} }
...@@ -153,16 +158,17 @@ auto_theora (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data) ...@@ -153,16 +158,17 @@ auto_theora (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
#if USE_THEORA_PRE_ALPHA_3_FORMAT #if USE_THEORA_PRE_ALPHA_3_FORMAT
/* old header format, used by Theora alpha2 and earlier */ /* old header format, used by Theora alpha2 and earlier */
keyframe_granule_shift = (header[36] & 0xf8) >> 3; keyframe_granule_shift = (header[36] & 0xf8) >> 3;
tdata->keyframe_shift = intlog (keyframe_granule_shift - 1);
#else #else
keyframe_granule_shift = (char) ((header[40] & 0x03) << 3); keyframe_granule_shift = (char) ((header[40] & 0x03) << 3);
keyframe_granule_shift |= (header[41] & 0xe0) >> 5; keyframe_granule_shift |= (header[41] & 0xe0) >> 5;
tdata->keyframe_shift = keyframe_granule_shift;
#endif #endif
tdata->keyframe_shift = intlog (keyframe_granule_shift - 1);
#ifdef DEBUG #ifdef DEBUG
printf ("Got theora fps %d/%d, keyframe_granule_shift %d\n", printf ("Got theora fps %d/%d, keyframe_shift %d\n",
tdata->fps_numerator, tdata->fps_denominator, tdata->fps_numerator, tdata->fps_denominator,
keyframe_granule_shift); tdata->keyframe_shift);
#endif #endif
/*oggz_set_metric_internal (oggz, serialno, auto_theora_metric, tdata, 1);*/ /*oggz_set_metric_internal (oggz, serialno, auto_theora_metric, tdata, 1);*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment