]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/smacker.c
Add av_clip_uintp2() function
[ffmpeg] / libavformat / smacker.c
index 42d3672d79d59a275253eaa454d433d1205c1c82..01d1303ae39f6cdb08e167812b047eea98c03701 100644 (file)
@@ -2,20 +2,20 @@
  * Smacker demuxer
  * Copyright (c) 2006 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
  */
 
@@ -219,7 +219,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
     ((int32_t*)st->codec->extradata)[3] = av_le2ne32(smk->type_size);
 
     smk->curstream = -1;
-    smk->nextpos = url_ftell(pb);
+    smk->nextpos = avio_tell(pb);
 
     return 0;
 }
@@ -235,16 +235,16 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
     int palchange = 0;
     int pos;
 
-    if (url_feof(s->pb) || smk->cur_frame >= smk->frames)
+    if (s->pb->eof_reached || smk->cur_frame >= smk->frames)
         return AVERROR_EOF;
 
     /* if we demuxed all streams, pass another frame */
     if(smk->curstream < 0) {
-        url_fseek(s->pb, smk->nextpos, 0);
+        avio_seek(s->pb, smk->nextpos, 0);
         frame_size = smk->frm_size[smk->cur_frame] & (~3);
         flags = smk->frm_flags[smk->cur_frame];
         /* handle palette change event */
-        pos = url_ftell(s->pb);
+        pos = avio_tell(s->pb);
         if(flags & SMACKER_PAL){
             int size, sz, t, off, j, pos;
             uint8_t *pal = smk->pal;
@@ -256,7 +256,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
             frame_size -= size;
             frame_size--;
             sz = 0;
-            pos = url_ftell(s->pb) + size;
+            pos = avio_tell(s->pb) + size;
             while(sz < 256){
                 t = avio_r8(s->pb);
                 if(t & 0x80){ /* skip palette entries */
@@ -279,7 +279,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
                     sz++;
                 }
             }
-            url_fseek(s->pb, pos, 0);
+            avio_seek(s->pb, pos, 0);
             palchange |= 1;
         }
         flags >>= 1;
@@ -313,7 +313,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
         pkt->stream_index = smk->videoindex;
         pkt->size = ret + 769;
         smk->cur_frame++;
-        smk->nextpos = url_ftell(s->pb);
+        smk->nextpos = avio_tell(s->pb);
     } else {
         if (av_new_packet(pkt, smk->buf_sizes[smk->curstream]))
             return AVERROR(ENOMEM);