Changeset 710
- Timestamp:
- 2005-01-23 18:02:50 (4 years ago)
- Files:
-
- liboggz/trunk/src/liboggz/Makefile.am (modified) (1 diff)
- liboggz/trunk/src/liboggz/oggz.c (modified) (1 diff)
- liboggz/trunk/src/liboggz/oggz_auto.c (modified) (2 diffs)
- liboggz/trunk/src/liboggz/oggz_private.h (modified) (1 diff)
- liboggz/trunk/src/liboggz/oggz_stream.c (added)
- liboggz/trunk/src/liboggz/oggz_stream.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
liboggz/trunk/src/liboggz/Makefile.am
r403 r710 16 16 oggz_read.c oggz_write.c \ 17 17 oggz_auto.c oggz_auto.h \ 18 oggz_stream.c oggz_stream.h \ 18 19 oggz_table.c \ 19 20 oggz_vector.c oggz_vector.h liboggz/trunk/src/liboggz/oggz.c
r709 r710 260 260 261 261 ogg_stream_init (&stream->ogg_stream, (int)serialno); 262 263 stream->content = OGGZ_CONTENT_UNKNOWN; 262 264 263 265 stream->delivered_non_b_o_s = 0; liboggz/trunk/src/liboggz/oggz_auto.c
r709 r710 278 278 } 279 279 280 #if 0281 280 static int 282 281 auto_fishead (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data) 283 282 { 284 283 unsigned char * header = op->packet; 285 286 if (op->bytes < 8) return 0; 287 288 if (strncmp ((char *)header, "fishead", 8)) return 0; 289 if (!op->b_o_s) return 0; 290 291 /* Yeah ... set it up with a "linear" metric with numerator 0 :) */ 292 oggz_set_metric_linear (oggz, serialno, 0, 1); 293 294 return 1; 295 } 296 #endif 284 int content; 285 286 if (op->b_o_s) { 287 if (op->bytes < 8) return 0; 288 if (strncmp ((char *)header, "fishead", 8)) return 0; 289 oggz_stream_set_content (oggz, serialno, OGGZ_CONTENT_SKELETON); 290 } else if (op->e_o_s) { 291 content = oggz_stream_get_content (oggz, serialno); 292 if (content != OGGZ_CONTENT_SKELETON) return 0; 293 294 /* Finished processing the skeleton; apply a zero metric */ 295 oggz_set_metric_linear (oggz, serialno, 0, 1); 296 } 297 298 return 1; 299 } 297 300 298 301 static int 299 302 auto_fisbone (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data) 300 303 { 304 int content; 301 305 unsigned char * header = op->packet; 302 306 long fisbone_serialno; /* The serialno referred to in this fisbone */ … … 306 310 307 311 if (strncmp ((char *)header, "fisbone", 7)) return 0; 312 content = oggz_stream_get_content (oggz, serialno); 313 if (content != OGGZ_CONTENT_SKELETON) return 0; 308 314 309 315 fisbone_serialno = (long) INT32_LE_AT(&header[12]); liboggz/trunk/src/liboggz/oggz_private.h
r709 r710 75 75 ogg_stream_state ogg_stream; 76 76 77 int content; 78 77 79 /* non b_o_s packet has been written (not just queued) */ 78 80 int delivered_non_b_o_s; liboggz/trunk/src/liboggz/oggz_stream.h
r709 r710 34 34 #define __OGGZ_STREAM_H__ 35 35 36 enum { 37 OGGZ_CONTENT_UNKNOWN = 0, 38 OGGZ_CONTENT_SKELETON = 1 39 }; 40 36 41 typedef struct _oggz_stream_t oggz_stream_t; 37 42 … … 40 45 41 46 int oggz_stream_has_metric (OGGZ * oggz, long serialno); 47 int oggz_stream_set_content (OGGZ * oggz, long serialno, int content); 48 int oggz_stream_get_content (OGGZ * oggz, long serialno); 42 49 43 50 #endif /* __OGGZ_STREAM_H__ */