X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsmacker.c;h=51a3b1b8b865f80303a2ecb5779d7d93772f3f1f;hb=bc8c50512fc8550ae80535390379e00937623e00;hp=8feb4e5f6993c265074ceac5aca564c2294264bd;hpb=6b4aa5dac8f41aa452d0ce9a1bede9e59a303060;p=ffmpeg diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 8feb4e5f699..51a3b1b8b86 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -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; } @@ -233,9 +233,8 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) int i; int frame_size = 0; 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 */ @@ -244,7 +243,6 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) 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); if(flags & SMACKER_PAL){ int size, sz, t, off, j, pos; uint8_t *pal = smk->pal; @@ -256,7 +254,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 */ @@ -313,7 +311,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); @@ -342,11 +340,11 @@ static int smacker_read_close(AVFormatContext *s) } AVInputFormat ff_smacker_demuxer = { - "smk", - NULL_IF_CONFIG_SMALL("Smacker video"), - sizeof(SmackerContext), - smacker_probe, - smacker_read_header, - smacker_read_packet, - smacker_read_close, + .name = "smk", + .long_name = NULL_IF_CONFIG_SMALL("Smacker video"), + .priv_data_size = sizeof(SmackerContext), + .read_probe = smacker_probe, + .read_header = smacker_read_header, + .read_packet = smacker_read_packet, + .read_close = smacker_read_close, };