[FFmpeg-devel] [PATCH] AVFormat: LRC demuxer and muxer

Derek Buitenhuis derek.buitenhuis at gmail.com
Wed Jul 9 16:24:34 CEST 2014


> +/*
> + * LRC lyrics file format decoder
> + * Copyright (c) 2014 StarBrilliant <m13253 at hotmail.com>

For copyright purposes we generally use real names.

> +#include "libavcodec/internal.h"

Ew. What are you using from this?

> +#include "libavutil/bprint.h"
> +#include "libavutil/dict.h"
> +
> +typedef struct LRCContext {
> +    FFDemuxSubtitlesQueue q;
> +    int ts_offset;

Is int enough for a timestamp difference?

> +    if(sscanf(p, "[-%d:%d.%d]", &mm, &ss, &cs) == 3) {\

'-' is a printf/scanf modifier, I'm not sure this will work.

> +        *start = -(mm*60000LL + ss*1000LL + cs*10LL); // just in case negative pts

Why are you mangling the timestamps? Negative timestamps are technically valid.

- Derek



More information about the ffmpeg-devel mailing list