if (tag1 == MKTAG('m', 'o', 'v', 'i')) {
avi->movi_list = url_ftell(pb) - 4;
if(size) avi->movi_end = avi->movi_list + size;
- else avi->movi_end = url_filesize(url_fileno(pb));
+ else avi->movi_end = url_fsize(pb);
#ifdef DEBUG
printf("movi end=%Lx\n", avi->movi_end);
#endif
nb_frames = get_le32(pb);
st->start_time = 0;
- st->duration = av_rescale(nb_frames, ast->scale*(int64_t)AV_TIME_BASE, ast->rate);
+ st->duration = nb_frames;
get_le32(pb); /* buffer size */
get_le32(pb); /* quality */
ast->sample_size = get_le32(pb); /* sample ssize */
codec_type = CODEC_TYPE_VIDEO;
ast->sample_size = 0;
- st->codec.frame_rate = ast->rate;
- st->codec.frame_rate_base = ast->scale;
break;
case MKTAG('a', 'u', 'd', 's'):
codec_type = CODEC_TYPE_AUDIO;
if(size > ast->remaining)
size= ast->remaining;
- av_new_packet(pkt, size);
- get_buffer(pb, pkt->data, size);
+ av_get_packet(pb, pkt, size);
if (avi->dv_demux) {
dstr = pkt->destruct;
index= av_index_search_timestamp(st, pkt->dts, 0);
e= &st->index_entries[index];
- if(e->timestamp == ast->frame_offset){
+ if(index >= 0 && e->timestamp == ast->frame_offset){
if (e->flags & AVINDEX_KEYFRAME)
pkt->flags |= PKT_FLAG_KEY;
}
if (i >= avi->movi_end) {
if (avi->is_odml) {
url_fskip(pb, avi->riff_end - i);
- avi->riff_end = avi->movi_end = url_filesize(url_fileno(pb));
+ avi->riff_end = avi->movi_end = url_fsize(pb);
} else
break;
}
st = s->streams[n];
ast = st->priv_data;
- if(st->discard){
+ if( (st->discard >= AVDISCARD_DEFAULT && size==0)
+ /*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/ //FIXME needs a little reordering
+ || st->discard >= AVDISCARD_ALL){
+ if(ast->sample_size) ast->frame_offset += pkt->size;
+ else ast->frame_offset++;
url_fskip(pb, size);
goto resync;
}
ast->packet_size= size + 8;
ast->remaining= size;
goto resync;
-
}
}
/* palette changed chunk */