diff options
Diffstat (limited to 'libavformat/paf.c')
-rw-r--r-- | libavformat/paf.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libavformat/paf.c b/libavformat/paf.c index 9ee4cd8..4fc5006 100644 --- a/libavformat/paf.c +++ b/libavformat/paf.c @@ -2,31 +2,29 @@ * Packed Animation File demuxer * Copyright (c) 2012 Paul B Mahol * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg 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. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg 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 Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/channel_layout.h" - +#include "libavcodec/paf.h" #include "avformat.h" #include "internal.h" #define MAGIC "Packed Animation File V1.0\n(c) 1992-96 Amazing Studio\x0a\x1a" -#define PAF_SOUND_SAMPLES 2205 -#define PAF_SOUND_FRAME_SIZE ((256 + PAF_SOUND_SAMPLES) * 2) typedef struct PAFDemuxContext { uint32_t buffer_size; @@ -195,10 +193,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) { PAFDemuxContext *p = s->priv_data; AVIOContext *pb = s->pb; - uint32_t count, offset; - int size, i; + uint32_t count, offset; + int size, i; + + if (p->current_frame >= p->nb_frames) + return AVERROR_EOF; - if (p->current_frame >= p->nb_frames || pb->eof_reached) + if (avio_feof(pb)) return AVERROR_EOF; if (p->got_audio) { |