GET_V(stc->msb_pts_shift, tmp < 16);
stc->max_pts_distance = ffio_read_varlen(bc);
GET_V(stc->decode_delay, tmp < 1000); // sanity limit, raise this if Moore's law is true
- st->codec->has_b_frames = stc->decode_delay;
ffio_read_varlen(bc); // stream flags
GET_V(st->codec->extradata_size, tmp < (1 << 30));
int64_t value, end;
char name[256], str_value[1024], type_str[256];
const char *type;
+ int *event_flags = NULL;
AVChapter *chapter = NULL;
AVStream *st = NULL;
AVDictionary **metadata = NULL;
+ int metadata_flag = 0;
end = get_packetheader(nut, bc, 1, INFO_STARTCODE);
end += avio_tell(bc);
} else if (stream_id_plus1) {
st = s->streams[stream_id_plus1 - 1];
metadata = &st->metadata;
- } else
+ event_flags = &st->event_flags;
+ metadata_flag = AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
+ } else {
metadata = &s->metadata;
+ event_flags = &s->event_flags;
+ metadata_flag = AVFMT_EVENT_FLAG_METADATA_UPDATED;
+ }
for (i = 0; i < count; i++) {
get_str(bc, name, sizeof(name));
continue;
}
if (metadata && av_strcasecmp(name, "Uses") &&
- av_strcasecmp(name, "Depends") && av_strcasecmp(name, "Replaces"))
+ av_strcasecmp(name, "Depends") && av_strcasecmp(name, "Replaces")) {
+ if (event_flags)
+ *event_flags |= metadata_flag;
av_dict_set(metadata, name, str_value, 0);
+ }
}
}
{
AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb;
- int size, stream_id, discard;
+ int size, stream_id, discard, ret;
int64_t pts, last_IP_pts;
StreamContext *stc;
uint8_t header_idx;
return 1;
}
- av_new_packet(pkt, size + nut->header_len[header_idx]);
+ ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
+ if (ret < 0)
+ return ret;
memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
pkt->pos = avio_tell(bc); // FIXME
avio_read(bc, pkt->data + nut->header_len[header_idx], size);