Changeset 3739

Show
Ignore:
Timestamp:
2008-10-27 01:04:40 (2 months ago)
Author:
conrad
Message:

anx_ogg_importer: for tracks with granuleshift, estimate the start granule as
1 granule before the time of the keyframe. Should be correct for Theora
(ie. 1 frame) and usually 1ms for CMML.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libannodex/trunk/src/importers/anx_import_ogg.c

    r3589 r3739  
    842842 * loop will end. 
    843843 * 
    844  * NOTE THAT this starts scanning from the specified startpos for the media. 
     844 * Note that in anxogg_setup() below, this packet reading callback is 
     845 * used after seeking to the specified startpos for the media. 
    845846 */ 
    846847static int 
     
    862863 
    863864  granulepos = ogg_page_granulepos ((ogg_page *)og); 
     865  if (granulepos == -1) return OGGZ_STOP_OK; 
    864866 
    865867#ifdef DEBUG 
     
    906908     
    907909    /* Slurp in granuleinfo */ 
    908     if (aot->need_keygranule && granulepos != -1) { 
     910    if (aot->need_keygranule) { 
    909911      iframe = granulepos >> track->granuleshift; 
    910912      pframe = granulepos - (iframe << track->granuleshift); 
     913 
     914      if (iframe > 0 && track->basegranule == 0.0) 
     915        track->basegranule = (iframe-1) << track->granuleshift; 
    911916 
    912917#if 1 
     
    928933      aot->keygranule = iframe << track->granuleshift; 
    929934      aot->need_keygranule = 0; 
    930        
     935 
    931936      offset = gp_to_time (aod->oggz, serialno, aot->keygranule); 
    932937      aot->keygranule_time = offset;