X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fads.c;h=e7b419ce8d4895b3879e4205eb4274b6537788cc;hb=4be1714b12b6c311a99a64888ea5f279c3ed9885;hp=73ea7c7d54b8c46d9a3b4d7f43c1dcd85be4e59e;hpb=ce47f1589e9f5a6cf8372a269bdd862ff0cc3f91;p=ffmpeg diff --git a/libavformat/ads.c b/libavformat/ads.c index 73ea7c7d54b..e7b419ce8d4 100644 --- a/libavformat/ads.c +++ b/libavformat/ads.c @@ -23,7 +23,7 @@ #include "avformat.h" #include "internal.h" -static int ads_probe(AVProbeData *p) +static int ads_probe(const AVProbeData *p) { if (memcmp(p->buf, "SShd", 4) || memcmp(p->buf+32, "SSbd", 4)) @@ -34,8 +34,9 @@ static int ads_probe(AVProbeData *p) static int ads_read_header(AVFormatContext *s) { - int align, codec, size; + int align, codec; AVStream *st; + int64_t size; st = avformat_new_stream(s, NULL); if (!st) @@ -62,7 +63,7 @@ static int ads_read_header(AVFormatContext *s) st->codecpar->block_align = st->codecpar->channels * align; avio_skip(s->pb, 12); size = avio_rl32(s->pb); - if (st->codecpar->codec_id == AV_CODEC_ID_ADPCM_PSX) + if (st->codecpar->codec_id == AV_CODEC_ID_ADPCM_PSX && size >= 0x40) st->duration = (size - 0x40) / 16 / st->codecpar->channels * 28; avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); @@ -79,7 +80,7 @@ static int ads_read_packet(AVFormatContext *s, AVPacket *pkt) return ret; } -AVInputFormat ff_ads_demuxer = { +const AVInputFormat ff_ads_demuxer = { .name = "ads", .long_name = NULL_IF_CONFIG_SMALL("Sony PS2 ADS"), .read_probe = ads_probe,