]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dxa.c
avio: cosmetics - nicer vertical alignment.
[ffmpeg] / libavformat / dxa.c
index 695ca959e1f4dffd2e5e26fa754c6d78e76a1793..7fec26fd9e0ae6cd5fbac7f920e74c6b6874d883 100644 (file)
@@ -2,20 +2,20 @@
  * DXA demuxer
  * Copyright (c) 2007 Konstantin Shishkov
  *
- * 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
  */
 
@@ -95,8 +95,8 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
         uint32_t size, fsize;
         c->has_sound = 1;
         size = avio_rb32(pb);
-        c->vidpos = url_ftell(pb) + size;
-        avio_seek(pb, 16, SEEK_CUR);
+        c->vidpos = avio_tell(pb) + size;
+        avio_skip(pb, 16);
         fsize = avio_rl32(pb);
 
         ast = av_new_stream(s, 0);
@@ -104,17 +104,17 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
             return -1;
         ff_get_wav_header(pb, ast->codec, fsize);
         // find 'data' chunk
-        while(url_ftell(pb) < c->vidpos && !url_feof(pb)){
+        while(avio_tell(pb) < c->vidpos && !pb->eof_reached){
             tag = avio_rl32(pb);
             fsize = avio_rl32(pb);
             if(tag == MKTAG('d', 'a', 't', 'a')) break;
-            avio_seek(pb, fsize, SEEK_CUR);
+            avio_skip(pb, fsize);
         }
         c->bpc = (fsize + c->frames - 1) / c->frames;
         if(ast->codec->block_align)
             c->bpc = ((c->bpc + ast->codec->block_align - 1) / ast->codec->block_align) * ast->codec->block_align;
         c->bytes_left = fsize;
-        c->wavpos = url_ftell(pb);
+        c->wavpos = avio_tell(pb);
         avio_seek(pb, c->vidpos, SEEK_SET);
     }
 
@@ -133,7 +133,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
         st->codec->height >>= 1;
     }
     c->readvid = !c->has_sound;
-    c->vidpos  = url_ftell(pb);
+    c->vidpos  = avio_tell(pb);
     s->start_time = 0;
     s->duration = (int64_t)c->frames * AV_TIME_BASE * num / den;
     av_log(s, AV_LOG_DEBUG, "%d frame(s)\n",c->frames);
@@ -158,11 +158,11 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
         if(ret != size)
             return AVERROR(EIO);
         c->bytes_left -= size;
-        c->wavpos = url_ftell(s->pb);
+        c->wavpos = avio_tell(s->pb);
         return 0;
     }
     avio_seek(s->pb, c->vidpos, SEEK_SET);
-    while(!url_feof(s->pb) && c->frames){
+    while(!s->pb->eof_reached && c->frames){
         avio_read(s->pb, buf, 4);
         switch(AV_RL32(buf)){
         case MKTAG('N', 'U', 'L', 'L'):
@@ -172,7 +172,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
             if(pal_size) memcpy(pkt->data, pal, pal_size);
             memcpy(pkt->data + pal_size, buf, 4);
             c->frames--;
-            c->vidpos = url_ftell(s->pb);
+            c->vidpos = avio_tell(s->pb);
             c->readvid = 0;
             return 0;
         case MKTAG('C', 'M', 'A', 'P'):
@@ -198,7 +198,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
             if(pal_size) memcpy(pkt->data, pal, pal_size);
             pkt->stream_index = 0;
             c->frames--;
-            c->vidpos = url_ftell(s->pb);
+            c->vidpos = avio_tell(s->pb);
             c->readvid = 0;
             return 0;
         default: