int leading;
} FilmstripDemuxContext;
-static int read_header(AVFormatContext *s,
- AVFormatParameters *ap)
+static int read_header(AVFormatContext *s)
{
FilmstripDemuxContext *film = s->priv_data;
AVIOContext *pb = s->pb;
st->nb_frames = avio_rb32(pb);
if (avio_rb16(pb) != 0) {
- av_log_ask_for_sample(s, "unsupported packing method\n");
- return AVERROR_INVALIDDATA;
+ avpriv_request_sample(s, "Unsupported packing method");
+ return AVERROR_PATCHWELCOME;
}
avio_skip(pb, 2);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
- st->codec->codec_id = CODEC_ID_RAWVIDEO;
- st->codec->pix_fmt = PIX_FMT_RGBA;
+ st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+ st->codec->pix_fmt = AV_PIX_FMT_RGBA;
st->codec->codec_tag = 0; /* no fourcc */
st->codec->width = avio_rb16(pb);
st->codec->height = avio_rb16(pb);
static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
AVStream *st = s->streams[stream_index];
- avio_seek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET);
+ if (avio_seek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET) < 0)
+ return -1;
return 0;
}
.read_header = read_header,
.read_packet = read_packet,
.read_seek = read_seek,
- .extensions = "flm",
+ .extensions = "flm",
};