[FFmpeg-devel] [PATCH] avformat/scd: add demuxer
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Fri Nov 26 17:32:29 EET 2021
Zane van Iperen:
> +
> +static int scd_seek(AVFormatContext *s, int stream_index,
> + int64_t pts, int flags)
> +{
> + SCDDemuxContext *ctx = s->priv_data;
> + SCDTrackHeader *trk = ctx->tracks + stream_index;
> +
> + if (pts != 0)
> + return AVERROR(EINVAL);
> +
> + trk->bytes_read = 0;
You are only resetting the one track that the user explicitly specified.
This is not in line with how this flag is generally understood.
> + return 0;
> +
> +}
Weird empty lines.
> +static int scd_read_close(AVFormatContext *s)
> +{
> + SCDDemuxContext *ctx = s->priv_data;
> +
> + av_freep(&ctx->hdr.table0.entries);
> + av_freep(&ctx->hdr.table1.entries);
> + av_freep(&ctx->hdr.table2.entries);
> + av_freep(&ctx->tracks);
> + return 0;
> +}
> +
> +const AVInputFormat ff_scd_demuxer = {
> + .name = "scd",
> + .long_name = NULL_IF_CONFIG_SMALL("Square Enix SCD"),
> + .priv_data_size = sizeof(SCDDemuxContext),
> + .flags_internal = FF_FMT_INIT_CLEANUP,
> + .read_probe = scd_probe,
> + .read_header = scd_read_header,
> + .read_packet = scd_read_packet,
> + .read_seek = scd_seek,
> + .read_close = scd_read_close,
> +};
>
More information about the ffmpeg-devel
mailing list