pal_size = FFMIN(pal_size, st->codecpar->extradata_size);
pal_src = st->codecpar->extradata +
st->codecpar->extradata_size - pal_size;
-#if HAVE_BIGENDIAN
for (i = 0; i < pal_size / 4; i++)
- ast->pal[i] = av_bswap32(((uint32_t *)pal_src)[i]);
-#else
- memcpy(ast->pal, pal_src, pal_size);
-#endif
+ ast->pal[i] = (0xFFu << 24) | AV_RL32(pal_src + 4 * i);
ast->has_pal = 1;
}
break;
case MKTAG('i', 'n', 'd', 'x'):
pos = avio_tell(pb);
- if (pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) &&
+ if ((pb->seekable & AVIO_SEEKABLE_NORMAL) &&
+ !(s->flags & AVFMT_FLAG_IGNIDX) &&
read_braindead_odml_indx(s, 0) < 0 &&
(s->error_recognition & AV_EF_EXPLODE))
goto fail;
return AVERROR_INVALIDDATA;
}
- if (!avi->index_loaded && pb->seekable)
+ if (!avi->index_loaded && (pb->seekable & AVIO_SEEKABLE_NORMAL))
avi_load_index(s);
avi->index_loaded = 1;
// pkt->dts += ast->start;
if (ast->sample_size)
pkt->dts /= ast->sample_size;
- av_log(s, AV_LOG_TRACE,
- "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d "
- "base:%d st:%d size:%d\n",
- pkt->dts,
- ast->frame_offset,
- ast->scale,
- ast->rate,
- ast->sample_size,
- AV_TIME_BASE,
- avi->stream_index,
- size);
pkt->stream_index = avi->stream_index;
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
break;
tag = avio_rl32(pb);
size = avio_rl32(pb);
- av_log(s, AV_LOG_TRACE, "tag=%c%c%c%c size=0x%x\n",
- tag & 0xff,
- (tag >> 8) & 0xff,
- (tag >> 16) & 0xff,
- (tag >> 24) & 0xff,
- size);
if (tag == MKTAG('i', 'd', 'x', '1') &&
avi_read_idx1(s, size) >= 0) {