Changeset 702

Show
Ignore:
Timestamp:
2005-01-21 21:39:52 (4 years ago)
Author:
conrad
Message:

when parsing a fisbone, don't set the metric for a bitstream if it's already
been set (eg. by having previously parsed a codec BOS page)

Files:

Legend:

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

    r700 r702  
    4343#include <string.h> 
    4444 
    45 #include <oggz/oggz.h> 
     45#include "oggz_private.h" 
    4646#include "oggz_auto.h" 
    4747#include "oggz_byteorder.h" 
     
    5353                              void * user_data, int internal); 
    5454 
     55int oggz_set_metric_linear (OGGZ * oggz, long serialno, 
     56                            ogg_int64_t granule_rate_numerator, 
     57                            ogg_int64_t granule_rate_denominator); 
     58 
    5559#define INT32_LE_AT(x) _le_32((*(ogg_int32_t *)(x))) 
    5660#define INT32_BE_AT(x) _be_32((*(ogg_int32_t *)(x))) 
    5761#define INT64_LE_AT(x) _le_64((*(ogg_int64_t *)(x))) 
    5862 
    59 #define DEBUG 
     63/*#define DEBUG*/ 
    6064 
    6165#define OGGZ_AUTO_MULT 1000 
     
    295299{ 
    296300  unsigned char * header = op->packet; 
    297   long fisbone_serialno; 
     301  long fisbone_serialno; /* The serialno referred to in this fisbone */ 
     302  oggz_stream_t * fisbone_stream; /* The stream of that serialno */ 
    298303  ogg_int64_t granule_rate_numerator = 0, granule_rate_denominator = 0; 
    299304 
     
    303308 
    304309  fisbone_serialno = (long) INT32_LE_AT(&header[12]); 
     310  fisbone_stream = oggz_get_stream (oggz, fisbone_serialno); 
     311 
     312  /* Don't override an already assigned metric */ 
     313  if (fisbone_stream->metric) return 1; 
    305314 
    306315  granule_rate_numerator = INT64_LE_AT(&header[20]);