]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/westwood.c
avio: deprecate url_get_filename().
[ffmpeg] / libavformat / westwood.c
index 10d579803567114cdc287a8a93f7c74776b7b670..7c2b17d11c156593cfe3454e94ec7a475ee89f04 100644 (file)
@@ -2,20 +2,20 @@
  * Westwood Studios Multimedia Formats Demuxer (VQA, AUD)
  * Copyright (c) 2003 The ffmpeg Project
  *
- * 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
  */
 
@@ -126,11 +126,11 @@ static int wsaud_read_header(AVFormatContext *s,
                              AVFormatParameters *ap)
 {
     WsAudDemuxContext *wsaud = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     unsigned char header[AUD_HEADER_SIZE];
 
-    if (get_buffer(pb, header, AUD_HEADER_SIZE) != AUD_HEADER_SIZE)
+    if (avio_read(pb, header, AUD_HEADER_SIZE) != AUD_HEADER_SIZE)
         return AVERROR(EIO);
     wsaud->audio_samplerate = AV_RL16(&header[0]);
     if (header[11] == 99)
@@ -168,12 +168,12 @@ static int wsaud_read_packet(AVFormatContext *s,
                              AVPacket *pkt)
 {
     WsAudDemuxContext *wsaud = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned char preamble[AUD_CHUNK_PREAMBLE_SIZE];
     unsigned int chunk_size;
     int ret = 0;
 
-    if (get_buffer(pb, preamble, AUD_CHUNK_PREAMBLE_SIZE) !=
+    if (avio_read(pb, preamble, AUD_CHUNK_PREAMBLE_SIZE) !=
         AUD_CHUNK_PREAMBLE_SIZE)
         return AVERROR(EIO);
 
@@ -213,7 +213,7 @@ static int wsvqa_read_header(AVFormatContext *s,
                              AVFormatParameters *ap)
 {
     WsVqaDemuxContext *wsvqa = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     unsigned char *header;
     unsigned char scratch[VQA_PREAMBLE_SIZE];
@@ -231,13 +231,13 @@ static int wsvqa_read_header(AVFormatContext *s,
     st->codec->codec_tag = 0;  /* no fourcc */
 
     /* skip to the start of the VQA header */
-    url_fseek(pb, 20, SEEK_SET);
+    avio_seek(pb, 20, SEEK_SET);
 
     /* the VQA header needs to go to the decoder */
     st->codec->extradata_size = VQA_HEADER_SIZE;
     st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
     header = (unsigned char *)st->codec->extradata;
-    if (get_buffer(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
+    if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
         VQA_HEADER_SIZE) {
         av_free(st->codec->extradata);
         return AVERROR(EIO);
@@ -277,7 +277,7 @@ static int wsvqa_read_header(AVFormatContext *s,
     /* there are 0 or more chunks before the FINF chunk; iterate until
      * FINF has been skipped and the file will be ready to be demuxed */
     do {
-        if (get_buffer(pb, scratch, VQA_PREAMBLE_SIZE) != VQA_PREAMBLE_SIZE) {
+        if (avio_read(pb, scratch, VQA_PREAMBLE_SIZE) != VQA_PREAMBLE_SIZE) {
             av_free(st->codec->extradata);
             return AVERROR(EIO);
         }
@@ -303,7 +303,7 @@ static int wsvqa_read_header(AVFormatContext *s,
             break;
         }
 
-        url_fseek(pb, chunk_size, SEEK_CUR);
+        avio_skip(pb, chunk_size);
     } while (chunk_tag != FINF_TAG);
 
     return 0;
@@ -313,14 +313,14 @@ static int wsvqa_read_packet(AVFormatContext *s,
                              AVPacket *pkt)
 {
     WsVqaDemuxContext *wsvqa = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret = -1;
     unsigned char preamble[VQA_PREAMBLE_SIZE];
     unsigned int chunk_type;
     unsigned int chunk_size;
     int skip_byte;
 
-    while (get_buffer(pb, preamble, VQA_PREAMBLE_SIZE) == VQA_PREAMBLE_SIZE) {
+    while (avio_read(pb, preamble, VQA_PREAMBLE_SIZE) == VQA_PREAMBLE_SIZE) {
         chunk_type = AV_RB32(&preamble[0]);
         chunk_size = AV_RB32(&preamble[4]);
         skip_byte = chunk_size & 0x01;
@@ -329,7 +329,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
 
             if (av_new_packet(pkt, chunk_size))
                 return AVERROR(EIO);
-            ret = get_buffer(pb, pkt->data, chunk_size);
+            ret = avio_read(pb, pkt->data, chunk_size);
             if (ret != chunk_size) {
                 av_free_packet(pkt);
                 return AVERROR(EIO);
@@ -348,7 +348,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
             }
             /* stay on 16-bit alignment */
             if (skip_byte)
-                url_fseek(pb, 1, SEEK_CUR);
+                avio_skip(pb, 1);
 
             return ret;
         } else {
@@ -359,7 +359,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
             default:
                 av_log(s, AV_LOG_INFO, "Skipping unknown chunk 0x%08X\n", chunk_type);
             }
-            url_fseek(pb, chunk_size + skip_byte, SEEK_CUR);
+            avio_skip(pb, chunk_size + skip_byte);
         }
     }
 
@@ -367,7 +367,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
 }
 
 #if CONFIG_WSAUD_DEMUXER
-AVInputFormat wsaud_demuxer = {
+AVInputFormat ff_wsaud_demuxer = {
     "wsaud",
     NULL_IF_CONFIG_SMALL("Westwood Studios audio format"),
     sizeof(WsAudDemuxContext),
@@ -377,7 +377,7 @@ AVInputFormat wsaud_demuxer = {
 };
 #endif
 #if CONFIG_WSVQA_DEMUXER
-AVInputFormat wsvqa_demuxer = {
+AVInputFormat ff_wsvqa_demuxer = {
     "wsvqa",
     NULL_IF_CONFIG_SMALL("Westwood Studios VQA format"),
     sizeof(WsVqaDemuxContext),