Lines Matching defs:avi

34 #include "avi.h"
99 .class_name = "avi",
149 AVIContext *avi = s->priv_data;
155 avi->riff_end = avio_rl32(pb); /* RIFF chunk size */
156 avi->riff_end += avio_tell(pb); /* RIFF chunk end */
174 AVIContext *avi = s->priv_data;
188 int64_t filesize = avi->fsize;
226 avi->odml_max_pos = FFMAX(avi->odml_max_pos, avio_tell(pb));
229 if (avi->odml_read > avi->odml_max_pos)
237 avi->odml_read += 8;
245 avi->non_interleaved = 1;
256 avi->odml_read += 16;
267 if (avi->odml_depth > MAX_ODML_DEPTH) {
274 avi->odml_depth++;
276 avi->odml_depth--;
287 avi->index_loaded = 2;
452 AVIContext *avi = s->priv_data;
469 if (maxpos < av_rescale(avi->io_fsize, 9, 10)) // index does not cover the whole file
497 AVIContext *avi = s->priv_data;
512 avi->stream_index = -1;
518 av_log(avi, AV_LOG_DEBUG, "use odml:%d\n", avi->use_odml);
520 avi->io_fsize = avi->fsize = avio_size(pb);
521 if (avi->fsize <= 0 || avi->fsize < avi->riff_end)
522 avi->fsize = avi->riff_end == 8 ? INT64_MAX : avi->riff_end;
545 avi->movi_list = avio_tell(pb) - 4;
547 avi->movi_end = avi->movi_list + size + (size & 1);
549 avi->movi_end = avi->fsize;
550 av_log(s, AV_LOG_TRACE, "movi end=%"PRIx64"\n", avi->movi_end);
568 avi->is_odml = 1;
579 avi->non_interleaved |= avio_rl32(pb) & AVIF_MUSTUSEINDEX;
637 avi->dv_demux = avpriv_dv_init_demux(s);
638 if (!avi->dv_demux) {
740 if (st->duration > 0 && avi->io_fsize > 0 && avi->riff_end > avi->io_fsize) {
742 st->duration = av_rescale(st->duration, avi->io_fsize, avi->riff_end);
753 if (stream_index >= (unsigned)s->nb_streams || avi->dv_demux) {
787 if (size > 10 * 4 && size < (1 << 30) && size < avi->fsize) {
838 "mov tag found in avi (fourcc %s)\n",
899 * (fix for Stargate SG-1 - 3x18 - Shades of Grey.avi) */
983 avi->use_odml &&
1041 avi->movi_list = avio_tell(pb) - 4;
1042 avi->movi_end = avi->fsize;
1059 if (!avi->index_loaded && (pb->seekable & AVIO_SEEKABLE_NORMAL))
1062 avi->index_loaded |= 1;
1067 avi->non_interleaved |= ret | (s->flags & AVFMT_FLAG_SORT_DTS);
1085 if (avi->dv_demux)
1086 avi->non_interleaved = 0;
1087 if (i == s->nb_streams && avi->non_interleaved) {
1090 avi->non_interleaved = 0;
1093 if (avi->non_interleaved) {
1232 AVIContext *avi = s->priv_data;
1253 if (i*(avi->io_fsize>0) + (uint64_t)size > avi->fsize || d[0] > 127)
1274 if (!((i - avi->last_pkt_pos) & 1) &&
1289 if (avi->dv_demux && n != 0)
1307 // workaround for broken small-file-bug402.avi
1349 if (!avi->dv_demux &&
1361 avi->stream_index = n;
1386 AVIContext *avi = s->priv_data;
1445 avi->stream_index = best_stream_index;
1458 AVIContext *avi = s->priv_data;
1462 if (CONFIG_DV_DEMUXER && avi->dv_demux) {
1463 int size = avpriv_dv_get_packet(avi->dv_demux, pkt);
1470 if (avi->non_interleaved) {
1477 if (avi->stream_index >= 0) {
1478 AVStream *st = s->streams[avi->stream_index];
1481 int dv_demux = CONFIG_DV_DEMUXER && avi->dv_demux;
1498 avi->last_pkt_pos = avio_tell(pb);
1519 size = avpriv_dv_produce_packet(avi->dv_demux, pkt,
1527 avi->stream_index = -1;
1536 pkt->stream_index = avi->stream_index;
1572 avi->stream_index = -1;
1576 if (!avi->non_interleaved && pkt->pos >= 0 && ast->seek_pos > pkt->pos) {
1582 if (!avi->non_interleaved && sti->nb_index_entries > 1 && avi->index_loaded > 1) {
1585 if (avi->dts_max < dts) {
1586 avi->dts_max = dts;
1587 } else if (avi->dts_max - (uint64_t)dts > 2*AV_TIME_BASE) {
1588 avi->non_interleaved= 1;
1605 AVIContext *avi = s->priv_data;
1622 avio_seek(pb, avi->movi_list + 4, SEEK_SET);
1625 avi->stream_index = -1;
1630 data_offset = avi->movi_list;
1658 if (avi->movi_list + 4 != pos || pos + 500 > first_packet_pos)
1669 avi->non_interleaved = 1;
1794 AVIContext *avi = s->priv_data;
1801 if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
1803 av_log(s, AV_LOG_TRACE, "movi_end=0x%"PRIx64"\n", avi->movi_end);
1816 avi->index_loaded=2;
1848 AVIContext *avi = s->priv_data;
1855 /* Does not matter which stream is requested dv in avi has the
1858 if (avi->dv_demux)
1861 if (!avi->index_loaded) {
1864 avi->index_loaded |= 1;
1890 if (CONFIG_DV_DEMUXER && avi->dv_demux) {
1900 ff_dv_offset_reset(avi->dv_demux, timestamp);
1902 avi->stream_index = -1;
1951 while (!avi->non_interleaved && index > 0 && sti2->index_entries[index-1].pos >= pos_min)
1961 avi->stream_index = -1;
1962 avi->dts_max = INT_MIN;
1969 AVIContext *avi = s->priv_data;
1984 av_freep(&avi->dv_demux);
2003 .name = "avi",
2007 .extensions = "avi",