* Wing Commander III Movie (.mve) File Demuxer
* 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
*/
AVFormatParameters *ap)
{
Wc3DemuxContext *wc3 = s->priv_data;
- ByteIOContext *pb = s->pb;
+ AVIOContext *pb = s->pb;
unsigned int fourcc_tag;
unsigned int size;
AVStream *st;
wc3->vpkt.data = NULL; wc3->vpkt.size = 0;
/* skip the first 3 32-bit numbers */
- url_fseek(pb, 12, SEEK_CUR);
+ avio_skip(pb, 12);
/* traverse through the chunks and load the header information before
* the first BRCH tag */
- fourcc_tag = get_le32(pb);
- size = (get_be32(pb) + 1) & (~1);
+ fourcc_tag = avio_rl32(pb);
+ size = (avio_rb32(pb) + 1) & (~1);
do {
switch (fourcc_tag) {
case SOND_TAG:
case INDX_TAG:
/* SOND unknown, INDX unnecessary; ignore both */
- url_fseek(pb, size, SEEK_CUR);
+ avio_skip(pb, size);
break;
case PC__TAG:
/* number of palettes, unneeded */
- url_fseek(pb, 12, SEEK_CUR);
+ avio_skip(pb, 12);
break;
case BNAM_TAG:
buffer = av_malloc(size+1);
if (!buffer)
return AVERROR(ENOMEM);
- if ((ret = get_buffer(pb, buffer, size)) != size)
+ if ((ret = avio_read(pb, buffer, size)) != size)
return AVERROR(EIO);
buffer[size] = 0;
av_metadata_set2(&s->metadata, "title", buffer,
case SIZE_TAG:
/* video resolution override */
- wc3->width = get_le32(pb);
- wc3->height = get_le32(pb);
+ wc3->width = avio_rl32(pb);
+ wc3->height = avio_rl32(pb);
break;
case PALT_TAG:
/* one of several palettes */
- url_fseek(pb, -8, SEEK_CUR);
+ avio_seek(pb, -8, SEEK_CUR);
av_append_packet(pb, &wc3->vpkt, 8 + PALETTE_SIZE);
break;
break;
}
- fourcc_tag = get_le32(pb);
+ fourcc_tag = avio_rl32(pb);
/* chunk sizes are 16-bit aligned */
- size = (get_be32(pb) + 1) & (~1);
- if (url_feof(pb))
+ size = (avio_rb32(pb) + 1) & (~1);
+ if (pb->eof_reached)
return AVERROR(EIO);
} while (fourcc_tag != BRCH_TAG);
AVPacket *pkt)
{
Wc3DemuxContext *wc3 = s->priv_data;
- ByteIOContext *pb = s->pb;
+ AVIOContext *pb = s->pb;
unsigned int fourcc_tag;
unsigned int size;
int packet_read = 0;
while (!packet_read) {
- fourcc_tag = get_le32(pb);
+ fourcc_tag = avio_rl32(pb);
/* chunk sizes are 16-bit aligned */
- size = (get_be32(pb) + 1) & (~1);
- if (url_feof(pb))
+ size = (avio_rb32(pb) + 1) & (~1);
+ if (pb->eof_reached)
return AVERROR(EIO);
switch (fourcc_tag) {
case SHOT_TAG:
/* load up new palette */
- url_fseek(pb, -8, SEEK_CUR);
+ avio_seek(pb, -8, SEEK_CUR);
av_append_packet(pb, &wc3->vpkt, 8 + 4);
break;
case VGA__TAG:
/* send out video chunk */
- url_fseek(pb, -8, SEEK_CUR);
+ avio_seek(pb, -8, SEEK_CUR);
ret= av_append_packet(pb, &wc3->vpkt, 8 + size);
// ignore error if we have some data
if (wc3->vpkt.size > 0)
case TEXT_TAG:
/* subtitle chunk */
#if 0
- url_fseek(pb, size, SEEK_CUR);
+ avio_skip(pb, size);
#else
- if ((unsigned)size > sizeof(text) || (ret = get_buffer(pb, text, size)) != size)
+ if ((unsigned)size > sizeof(text) || (ret = avio_read(pb, text, size)) != size)
ret = AVERROR(EIO);
else {
int i = 0;