[FFmpeg-devel] [PATCH] avfilter: add gmsd filter

James Almer jamrial at gmail.com
Tue Oct 22 16:10:29 EEST 2019


On 10/22/2019 10:02 AM, Paul B Mahol wrote:
> +static av_cold int init(AVFilterContext *ctx)
> +{
> +    GMSDContext *s = ctx->priv;
> +
> +    if (s->stats_file_str) {
> +        if (!strcmp(s->stats_file_str, "-")) {
> +            s->stats_file = stdout;
> +        } else {
> +            s->stats_file = fopen(s->stats_file_str, "w");

You could use av_fopen_utf8() instead.

> +            if (!s->stats_file) {
> +                int err = AVERROR(errno);
> +                char buf[128];
> +                av_strerror(err, buf, sizeof(buf));
> +                av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n",
> +                       s->stats_file_str, buf);
> +                return err;
> +            }
> +        }
> +    }
> +
> +    s->fs.on_event = do_gmsd;
> +
> +    return 0;
> +}



More information about the ffmpeg-devel mailing list