X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favs.c;h=ab47980a11c0519f0f2b80665f67467f6e5526c9;hb=4be1714b12b6c311a99a64888ea5f279c3ed9885;hp=62f5a42ac9242b5b09dd4096246348d9e57d22be;hpb=64425e005edf3bdd77c34c078c3e74ab5ecef557;p=ffmpeg diff --git a/libavformat/avs.c b/libavformat/avs.c index 62f5a42ac92..ab47980a11c 100644 --- a/libavformat/avs.c +++ b/libavformat/avs.c @@ -50,7 +50,7 @@ typedef enum avs_block_type { AVS_GAME_DATA = 0x04, } AvsBlockType; -static int avs_probe(AVProbeData * p) +static int avs_probe(const AVProbeData * p) { const uint8_t *d; @@ -114,7 +114,6 @@ avs_read_video_packet(AVFormatContext * s, AVPacket * pkt, pkt->data[palette_size + 3] = (size >> 8) & 0xFF; ret = avio_read(s->pb, pkt->data + palette_size + 4, size - 4) + 4; if (ret < size) { - av_packet_unref(pkt); return AVERROR(EIO); } @@ -129,7 +128,8 @@ avs_read_video_packet(AVFormatContext * s, AVPacket * pkt, static int avs_read_audio_packet(AVFormatContext * s, AVPacket * pkt) { AvsFormat *avs = s->priv_data; - int ret, size; + int ret; + int64_t size; size = avio_tell(s->pb); ret = ff_voc_get_packet(s, pkt, avs->st_audio, avs->remaining_audio_size); @@ -224,17 +224,11 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) } } -static int avs_read_close(AVFormatContext * s) -{ - return 0; -} - -AVInputFormat ff_avs_demuxer = { +const AVInputFormat ff_avs_demuxer = { .name = "avs", .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games Creature Shock"), .priv_data_size = sizeof(AvsFormat), .read_probe = avs_probe, .read_header = avs_read_header, .read_packet = avs_read_packet, - .read_close = avs_read_close, };