uint64_t pts;
} MlvContext;
-static int probe(AVProbeData *p)
+static int probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) == MKTAG('M','L','V','I') &&
AV_RL32(p->buf + 4) >= 52 &&
{
MlvContext *mlv = avctx->priv_data;
AVIOContext *pb;
- AVStream *st = avctx->streams[mlv->stream_index];
+ AVStream *st;
int index, ret;
unsigned int size, space;
+ if (!avctx->nb_streams)
+ return AVERROR_EOF;
+
+ st = avctx->streams[mlv->stream_index];
if (mlv->pts >= st->duration)
return AVERROR_EOF;
MlvContext *mlv = s->priv_data;
int i;
for (i = 0; i < 100; i++)
- if (mlv->pb[i])
- ff_format_io_close(s, &mlv->pb[i]);
+ ff_format_io_close(s, &mlv->pb[i]);
return 0;
}