#undef NDEBUG
#include <assert.h>
-#if FF_API_MAX_STREAMS
-#define NUT_MAX_STREAMS MAX_STREAMS
-#else
#define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */
-#endif
static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){
unsigned int len= ffio_read_varlen(bc);
startcode= av_be2ne64(startcode);
startcode= ff_crc04C11DB7_update(0, (uint8_t*)&startcode, 8);
- init_checksum(bc, ff_crc04C11DB7_update, startcode);
+ ffio_init_checksum(bc, ff_crc04C11DB7_update, startcode);
size= ffio_read_varlen(bc);
if(size > 4096)
avio_rb32(bc);
- if(get_checksum(bc) && size > 4096)
+ if(ffio_get_checksum(bc) && size > 4096)
return -1;
- init_checksum(bc, calculate_checksum ? ff_crc04C11DB7_update : NULL, 0);
+ ffio_init_checksum(bc, calculate_checksum ? ff_crc04C11DB7_update : NULL, 0);
return size;
}
uint64_t tmp, end;
unsigned int stream_count;
int i, j, tmp_stream, tmp_mul, tmp_pts, tmp_size, count, tmp_res, tmp_head_idx;
- int64_t tmp_match;
end= get_packetheader(nut, bc, 1, MAIN_STARTCODE);
end += avio_tell(bc);
tmp_pts=0;
tmp_mul=1;
tmp_stream=0;
- tmp_match= 1-(1LL<<62);
tmp_head_idx= 0;
for(i=0; i<256;){
int tmp_flags = ffio_read_varlen(bc);
else tmp_res = 0;
if(tmp_fields>5) count = ffio_read_varlen(bc);
else count = tmp_mul - tmp_size;
- if(tmp_fields>6) tmp_match = get_s(bc);
+ if(tmp_fields>6) get_s(bc);
if(tmp_fields>7) tmp_head_idx= ffio_read_varlen(bc);
while(tmp_fields-- > 8)
assert(nut->header_len[0]==0);
}
- if(skip_reserved(bc, end) || get_checksum(bc)){
+ if(skip_reserved(bc, end) || ffio_get_checksum(bc)){
av_log(s, AV_LOG_ERROR, "main header checksum mismatch\n");
return AVERROR_INVALIDDATA;
}
ffio_read_varlen(bc); // samplerate_den
GET_V(st->codec->channels, tmp > 0)
}
- if(skip_reserved(bc, end) || get_checksum(bc)){
+ if(skip_reserved(bc, end) || ffio_get_checksum(bc)){
av_log(s, AV_LOG_ERROR, "stream header %d checksum mismatch\n", stream_id);
return -1;
}
}
}
- if(skip_reserved(bc, end) || get_checksum(bc)){
+ if(skip_reserved(bc, end) || ffio_get_checksum(bc)){
av_log(s, AV_LOG_ERROR, "info header checksum mismatch\n");
return -1;
}
ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp / nut->time_base_count);
- if(skip_reserved(bc, end) || get_checksum(bc)){
+ if(skip_reserved(bc, end) || ffio_get_checksum(bc)){
av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");
return -1;
}
}
}
- if(skip_reserved(bc, end) || get_checksum(bc)){
+ if(skip_reserved(bc, end) || ffio_get_checksum(bc)){
av_log(s, AV_LOG_ERROR, "index checksum mismatch\n");
goto fail;
}
s->data_offset= pos-8;
- if(!url_is_streamed(bc)){
+ if(bc->seekable){
int64_t orig_pos= avio_tell(bc);
find_and_decode_index(nut);
avio_seek(bc, orig_pos, SEEK_SET);