[NUT-devel] [NUT] (ods15): r95 - /trunk/libnut/demuxer.c
syncmail at mplayerhq.hu
syncmail at mplayerhq.hu
Sat Mar 11 18:13:42 CET 2006
Author: ods15
Date: Sat Mar 11 18:13:42 2006
New Revision: 95
Log:
Add extendibility, there can be new headers anywhere
Modified:
trunk/libnut/demuxer.c
Modified: trunk/libnut/demuxer.c
==============================================================================
--- trunk/libnut/demuxer.c (original)
+++ trunk/libnut/demuxer.c Sat Mar 11 18:13:42 2006
@@ -708,7 +708,11 @@
uint64_t tmp;
int j;
CHECK(get_bytes(nut->i, 8, &tmp));
- if (tmp != STREAM_STARTCODE) return -ERR_NOSTREAM_STARTCODE;
+ while (tmp != STREAM_STARTCODE) {
+ ERROR(tmp >> 56 != 'N', -ERR_NOSTREAM_STARTCODE);
+ CHECK(get_header(nut->i, NULL));
+ CHECK(get_bytes(nut->i, 8, &tmp));
+ }
CHECK(get_stream_header(nut, i));
if (!nut->sc[i].pts_cache) {
nut->sc[i].pts_cache = malloc(nut->sc[i].sh.decode_delay * sizeof(int64_t));
@@ -719,6 +723,11 @@
if (nut->dopts.read_index) {
uint64_t tmp;
CHECK(get_bytes(nut->i, 8, &tmp));
+ while (tmp >> 56 == 'N') {
+ if (tmp == INDEX_STARTCODE) break;
+ CHECK(get_header(nut->i, NULL));
+ CHECK(get_bytes(nut->i, 8, &tmp));
+ }
if (tmp == INDEX_STARTCODE) nut->seek_status = 2;
nut->i->buf_ptr -= 8;
flush_buf(nut->i);
More information about the NUT-devel
mailing list