X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fiss.c;h=3f7f4feff2102950f7837e2a9e4831716e0e7620;hb=ade32b4a84000b4f0833f5bfaede5595e01bcc8f;hp=100066bad2ccdf7aa8384bc89c7da9bf578bfed0;hpb=ec679eb4530174fe8d1e06c6010597539f6c1c97;p=ffmpeg diff --git a/libavformat/iss.c b/libavformat/iss.c index 100066bad2c..3f7f4feff21 100644 --- a/libavformat/iss.c +++ b/libavformat/iss.c @@ -23,12 +23,12 @@ * @file * Funcom ISS file demuxer * @author Jaikrishnan Menon - * - * For more information on the .iss file format, visit: - * http://wiki.multimedia.cx/index.php?title=FunCom_ISS + * @see http://wiki.multimedia.cx/index.php?title=FunCom_ISS */ +#include "libavutil/channel_layout.h" #include "avformat.h" +#include "internal.h" #include "libavutil/avstring.h" #define ISS_SIG "IMA_ADPCM_Sound" @@ -66,7 +66,7 @@ static int iss_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) +static av_cold int iss_read_header(AVFormatContext *s) { IssDemuxContext *iss = s->priv_data; AVIOContext *pb = s->pb; @@ -90,12 +90,18 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) iss->sample_start_pos = avio_tell(pb); - 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_id = CODEC_ID_ADPCM_IMA_ISS; - st->codec->channels = stereo ? 2 : 1; + st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_ISS; + if (stereo) { + st->codec->channels = 2; + st->codec->channel_layout = AV_CH_LAYOUT_STEREO; + } else { + st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; + } st->codec->sample_rate = 44100; if(rate_divisor > 0) st->codec->sample_rate /= rate_divisor; @@ -103,7 +109,7 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_coded_sample; st->codec->block_align = iss->packet_size; - av_set_pts_info(st, 32, 1, st->codec->sample_rate); + avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate); return 0; } @@ -124,11 +130,10 @@ static int iss_read_packet(AVFormatContext *s, AVPacket *pkt) } AVInputFormat ff_iss_demuxer = { - "ISS", - NULL_IF_CONFIG_SMALL("Funcom ISS format"), - sizeof(IssDemuxContext), - iss_probe, - iss_read_header, - iss_read_packet, + .name = "iss", + .long_name = NULL_IF_CONFIG_SMALL("Funcom ISS"), + .priv_data_size = sizeof(IssDemuxContext), + .read_probe = iss_probe, + .read_header = iss_read_header, + .read_packet = iss_read_packet, }; -