OSDN Git Service

avconv: move top_field_first to options context.
[coroid/libav_saccubus.git] / libavformat / vocdec.c
index 01bbdb2..23f1b0d 100644 (file)
@@ -2,20 +2,20 @@
  * Creative Voice File demuxer.
  * Copyright (c) 2006  Aurelien Jacobs <aurel@gnuage.org>
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -45,13 +45,13 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap)
     int header_size;
     AVStream *st;
 
-    url_fskip(pb, 20);
+    avio_skip(pb, 20);
     header_size = avio_rl16(pb) - 22;
     if (header_size != 4) {
         av_log(s, AV_LOG_ERROR, "unknown header size: %d\n", header_size);
         return AVERROR(ENOSYS);
     }
-    url_fskip(pb, header_size);
+    avio_skip(pb, header_size);
     st = av_new_stream(s, 0);
     if (!st)
         return AVERROR(ENOMEM);
@@ -78,9 +78,9 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
             return AVERROR(EIO);
         voc->remaining_size = avio_rl24(pb);
         if (!voc->remaining_size) {
-            if (url_is_streamed(s->pb))
+            if (!s->pb->seekable)
                 return AVERROR(EIO);
-            voc->remaining_size = url_fsize(pb) - url_ftell(pb);
+            voc->remaining_size = avio_size(pb) - avio_tell(pb);
         }
         max_size -= 4;
 
@@ -114,13 +114,13 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
             dec->bits_per_coded_sample = avio_r8(pb);
             dec->channels = avio_r8(pb);
             tmp_codec = avio_rl16(pb);
-            url_fskip(pb, 4);
+            avio_skip(pb, 4);
             voc->remaining_size -= 12;
             max_size -= 12;
             break;
 
         default:
-            url_fskip(pb, voc->remaining_size);
+            avio_skip(pb, voc->remaining_size);
             max_size -= voc->remaining_size;
             voc->remaining_size = 0;
             break;
@@ -157,11 +157,11 @@ static int voc_read_packet(AVFormatContext *s, AVPacket *pkt)
 }
 
 AVInputFormat ff_voc_demuxer = {
-    "voc",
-    NULL_IF_CONFIG_SMALL("Creative Voice file format"),
-    sizeof(VocDecContext),
-    voc_probe,
-    voc_read_header,
-    voc_read_packet,
+    .name           = "voc",
+    .long_name      = NULL_IF_CONFIG_SMALL("Creative Voice file format"),
+    .priv_data_size = sizeof(VocDecContext),
+    .read_probe     = voc_probe,
+    .read_header    = voc_read_header,
+    .read_packet    = voc_read_packet,
     .codec_tag=(const AVCodecTag* const []){ff_voc_codec_tags, 0},
 };