]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/filmstripdec.c
url: Handle relative urls being just a new query string
[ffmpeg] / libavformat / filmstripdec.c
index 648fb4f384d6b675fe139c24784cca9c50c37612..7c327e93247a56c43dbbb150656a1336a2717654 100644 (file)
@@ -34,8 +34,7 @@ typedef struct {
     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;
@@ -62,8 +61,8 @@ static int read_header(AVFormatContext *s,
 
     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);
@@ -95,7 +94,8 @@ static int read_packet(AVFormatContext *s,
 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;
 }
 
@@ -106,5 +106,5 @@ AVInputFormat ff_filmstrip_demuxer = {
     .read_header    = read_header,
     .read_packet    = read_packet,
     .read_seek      = read_seek,
-    .extensions = "flm",
+    .extensions     = "flm",
 };