X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Feacdata.c;h=c81dec847d4c3fda7e9fef3e0195246d75ebd4be;hb=b8b21dee0f0b4bcc1888067c497d6e838859d2cd;hp=8fc8c4221e892def665f41a521de607bc486f0a4;hpb=e356fc57a2e9887370caec58d8aafeafd1f336dc;p=ffmpeg diff --git a/libavformat/eacdata.c b/libavformat/eacdata.c index 8fc8c4221e8..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,7 +45,7 @@ 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; AVIOContext *pb = s->pb; @@ -62,17 +63,17 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) }; sample_rate = avio_rb16(pb); - avio_seek(pb, 12, SEEK_CUR); + 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", };