Changeset 2733

Show
Ignore:
Timestamp:
2007-05-16 18:24:04 (2 years ago)
Author:
shans
Message:

Fix for freezing problem in CMMLWiki.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • liboggz/trunk/src/liboggz/oggz_auto.c

    r2573 r2733  
    665665      return (size ? info->long_size : info->short_size) / 2; 
    666666    } 
    667    
     667     
    668668    /* 
    669669     * if it's a short packet, then we can just use nsn_increment 
     
    685685      ) / 4; 
    686686    info->last_was_long = size; 
     687 
    687688    return result; 
    688689     
     
    885886                oggz_stream_t *stream, ogg_packet *op) { 
    886887  if (oggz_auto_codec_ident[content].calculator != NULL) { 
    887     return oggz_auto_codec_ident[content].calculator(now, stream, op); 
    888   } else { 
    889     return now; 
    890   } 
     888    ogg_int64_t r = oggz_auto_codec_ident[content].calculator(now, stream, op); 
     889    /* 
     890     * this will cause a hiccough at the end of the first data page if there are 
     891     * more than one packets on that page.  In the absence of pervasive access 
     892     * to the packets on a page, though, it might have to do. 
     893     * 
     894     * Why a hiccough?  Because there's no granulepos attached to any packets 
     895     * except for the last on a page.  If the stream doesn't start at gp 0 (a 
     896     * very common occurrence) then we don't realise until we get to the end of 
     897     * the page.  By that time we've already junked the first packets on the  
     898     * page. 
     899     */ 
     900    if (now != -1LL) { 
     901      return op->granulepos; 
     902    } 
     903    return r; 
     904  }  
     905 
     906  return now; 
     907   
    891908   
    892909}