}
}
-static int nut_probe(AVProbeData *p)
+static int nut_probe(const AVProbeData *p)
{
int i;
GET_V(st->codecpar->extradata_size, tmp < (1 << 30));
if (st->codecpar->extradata_size) {
- if (ff_get_extradata(s, st->codecpar, bc, st->codecpar->extradata_size) < 0)
- return AVERROR(ENOMEM);
+ ret = ff_get_extradata(s, st->codecpar, bc,
+ st->codecpar->extradata_size);
+ if (ret < 0)
+ return ret;
}
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
if (stream_id_plus1 && !strcmp(name, "r_frame_rate")) {
sscanf(str_value, "%d/%d", &st->r_frame_rate.num, &st->r_frame_rate.den);
if (st->r_frame_rate.num >= 1000LL*st->r_frame_rate.den ||
- st->r_frame_rate.num < 0 || st->r_frame_rate.num < 0)
+ st->r_frame_rate.num < 0 || st->r_frame_rate.den < 0)
st->r_frame_rate.num = st->r_frame_rate.den = 0;
continue;
}
}
stc = &nut->stream[*stream_id];
if (flags & FLAG_CODED_PTS) {
- int coded_pts = ffio_read_varlen(bc);
+ int64_t coded_pts = ffio_read_varlen(bc);
// FIXME check last_pts validity?
- if (coded_pts < (1 << stc->msb_pts_shift)) {
+ if (coded_pts < (1LL << stc->msb_pts_shift)) {
*pts = ff_lsb2full(stc, coded_pts);
} else
*pts = coded_pts - (1LL << stc->msb_pts_shift);
return AVERROR(ENOSYS);
}
- if (st->index_entries) {
+ if (st->internal->index_entries) {
int index = av_index_search_timestamp(st, pts, flags);
if (index < 0)
index = av_index_search_timestamp(st, pts, flags ^ AVSEEK_FLAG_BACKWARD);
if (index < 0)
return -1;
- pos2 = st->index_entries[index].pos;
- ts = st->index_entries[index].timestamp;
+ pos2 = st->internal->index_entries[index].pos;
+ ts = st->internal->index_entries[index].timestamp;
} else {
av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pts_cmp,
(void **) next_node);
av_assert0(sp);
pos2 = sp->back_ptr - 15;
}
- av_log(NULL, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos2);
+ av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos2);
pos = find_startcode(s->pb, SYNCPOINT_STARTCODE, pos2);
avio_seek(s->pb, pos, SEEK_SET);
nut->last_syncpoint_pos = pos;
- av_log(NULL, AV_LOG_DEBUG, "SP: %"PRId64"\n", pos);
+ av_log(s, AV_LOG_DEBUG, "SP: %"PRId64"\n", pos);
if (pos2 > pos || pos2 + 15 < pos)
- av_log(NULL, AV_LOG_ERROR, "no syncpoint at backptr pos\n");
+ av_log(s, AV_LOG_ERROR, "no syncpoint at backptr pos\n");
for (i = 0; i < s->nb_streams; i++)
nut->stream[i].skip_until_key_frame = 1;