X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Feacdata.c;h=c81dec847d4c3fda7e9fef3e0195246d75ebd4be;hb=e02de9df4b218bd6e1e927b67fd4075741545688;hp=809b190dd1f6cc4caf26d61f28650768b295b7ea;hpb=c6610a216ed2948885772154a2eed696e0cb4aca;p=ffmpeg diff --git a/libavformat/eacdata.c b/libavformat/eacdata.c index 809b190dd1f..c81dec847d4 100644 --- a/libavformat/eacdata.c +++ b/libavformat/eacdata.c @@ -2,20 +2,20 @@ * Electronic Arts .cdata file Demuxer * Copyright (c) 2007 Peter Ross * - * 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 */ @@ -29,8 +29,9 @@ */ #include "avformat.h" +#include "internal.h" -typedef struct { +typedef struct CdataDemuxContext { unsigned int channels; unsigned int audio_pts; } CdataDemuxContext; @@ -44,14 +45,14 @@ static int cdata_probe(AVProbeData *p) return 0; } -static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int cdata_read_header(AVFormatContext *s) { CdataDemuxContext *cdata = s->priv_data; - ByteIOContext *pb = s->pb; + AVIOContext *pb = s->pb; unsigned int sample_rate, header; AVStream *st; - header = get_be16(pb); + header = avio_rb16(pb); switch (header) { case 0x0400: cdata->channels = 1; break; case 0x0404: cdata->channels = 2; break; @@ -61,18 +62,18 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) return -1; }; - sample_rate = get_be16(pb); - url_fskip(pb, 12); + sample_rate = avio_rb16(pb); + avio_skip(pb, 12); - st = av_new_stream(s, 0); + st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = 0; /* no fourcc */ - st->codec->codec_id = CODEC_ID_ADPCM_EA_XAS; + st->codec->codec_id = AV_CODEC_ID_ADPCM_EA_XAS; st->codec->channels = cdata->channels; st->codec->sample_rate = sample_rate; - av_set_pts_info(st, 64, 1, sample_rate); + avpriv_set_pts_info(st, 64, 1, sample_rate); cdata->audio_pts = 0; return 0; @@ -91,11 +92,11 @@ static int cdata_read_packet(AVFormatContext *s, AVPacket *pkt) } AVInputFormat ff_ea_cdata_demuxer = { - "ea_cdata", - NULL_IF_CONFIG_SMALL("Electronic Arts cdata"), - sizeof(CdataDemuxContext), - cdata_probe, - cdata_read_header, - cdata_read_packet, + .name = "ea_cdata", + .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts cdata"), + .priv_data_size = sizeof(CdataDemuxContext), + .read_probe = cdata_probe, + .read_header = cdata_read_header, + .read_packet = cdata_read_packet, .extensions = "cdata", };