static int hls_start(AVFormatContext *s, VariantStream *vs)

{

    HLSContext *c = s->priv_data;

    AVFormatContext *oc = vs->avf;

    AVFormatContext *vtt_oc = vs->vtt_avf;

    AVDictionary *options = NULL;

    char *filename, iv_string[KEYSIZE*2 + 1];

    int err = 0;



    if (c->flags & HLS_SINGLE_FILE) {

        av_strlcpy(oc->filename, vs->basename,

                   sizeof(oc->filename));

        if (vs->vtt_basename)

            av_strlcpy(vtt_oc->filename, vs->vtt_basename,

                  sizeof(vtt_oc->filename));

    } else if (c->max_seg_size > 0) {

        if (replace_int_data_in_filename(oc->filename, sizeof(oc->filename),

#if FF_API_HLS_WRAP

            vs->basename, 'd', c->wrap ? vs->sequence % c->wrap : vs->sequence) < 1) {

#else

            vs->basename, 'd', vs->sequence) < 1) {

#endif

                av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s', you can try to use -use_localtime 1 with it\n", vs->basename);

                return AVERROR(EINVAL);

        }

    } else {

        if (c->use_localtime) {

            time_t now0;

            struct tm *tm, tmpbuf;

            time(&now0);

            tm = localtime_r(&now0, &tmpbuf);

            if (!strftime(oc->filename, sizeof(oc->filename), vs->basename, tm)) {

                av_log(oc, AV_LOG_ERROR, "Could not get segment filename with use_localtime\n");

                return AVERROR(EINVAL);

            }



            err = sls_flag_use_localtime_filename(oc, c, vs);

            if (err < 0) {

                return AVERROR(ENOMEM);

            }



            if (c->use_localtime_mkdir) {

                const char *dir;

                char *fn_copy = av_strdup(oc->filename);

                if (!fn_copy) {

                    return AVERROR(ENOMEM);

                }

                dir = av_dirname(fn_copy);

                if (mkdir_p(dir) == -1 && errno != EEXIST) {

                    av_log(oc, AV_LOG_ERROR, "Could not create directory %s with use_localtime_mkdir\n", dir);

                    av_free(fn_copy);

                    return AVERROR(errno);

                }

                av_free(fn_copy);

            }

        } else if (replace_int_data_in_filename(oc->filename, sizeof(oc->filename),

#if FF_API_HLS_WRAP

                   vs->basename, 'd', c->wrap ? vs->sequence % c->wrap : vs->sequence) < 1) {

#else

                   vs->basename, 'd', vs->sequence) < 1) {

#endif

            av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s' you can try to use -use_localtime 1 with it\n", vs->basename);

            return AVERROR(EINVAL);

        }

        if( vs->vtt_basename) {

            if (replace_int_data_in_filename(vtt_oc->filename, sizeof(vtt_oc->filename),

#if FF_API_HLS_WRAP

                vs->vtt_basename, 'd', c->wrap ? vs->sequence % c->wrap : vs->sequence) < 1) {

#else

                vs->vtt_basename, 'd', vs->sequence) < 1) {

#endif

                av_log(vtt_oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n", vs->vtt_basename);

                return AVERROR(EINVAL);

            }

       }

    }

    vs->number++;



    set_http_options(s, &options, c);



    if (c->flags & HLS_TEMP_FILE) {

        av_strlcat(oc->filename, ".tmp", sizeof(oc->filename));

    }



    if (c->key_info_file || c->encrypt) {

        if (c->key_info_file && c->encrypt) {

            av_log(s, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"

                  " will use -hls_key_info_file priority\n");

        }



        if (!c->encrypt_started || (c->flags & HLS_PERIODIC_REKEY)) {

            if (c->key_info_file) {

                if ((err = hls_encryption_start(s)) < 0)

                    goto fail;

            } else {

                if ((err = do_encrypt(s, vs)) < 0)

                    goto fail;

            }

            c->encrypt_started = 1;

        }

        if ((err = av_dict_set(&options, "encryption_key", c->key_string, 0))

                < 0)

            goto fail;

        err = av_strlcpy(iv_string, c->iv_string, sizeof(iv_string));

        if (!err)

            snprintf(iv_string, sizeof(iv_string), "%032"PRIx64, vs->sequence);

        if ((err = av_dict_set(&options, "encryption_iv", iv_string, 0)) < 0)

           goto fail;



        filename = av_asprintf("crypto:%s", oc->filename);

        if (!filename) {

            err = AVERROR(ENOMEM);

            goto fail;

        }

        err = hlsenc_io_open(s, &oc->pb, filename, &options);

        av_free(filename);

        av_dict_free(&options);

        if (err < 0)

            return err;

    } else if (c->segment_type != SEGMENT_TYPE_FMP4) {

        if ((err = hlsenc_io_open(s, &oc->pb, oc->filename, &options)) < 0)

            goto fail;

    }

    if (vs->vtt_basename) {

        set_http_options(s, &options, c);

        if ((err = hlsenc_io_open(s, &vtt_oc->pb, vtt_oc->filename, &options)) < 0)

            goto fail;

    }

    av_dict_free(&options);



    if (c->segment_type != SEGMENT_TYPE_FMP4) {

        /* We only require one PAT/PMT per segment. */

        if (oc->oformat->priv_class && oc->priv_data) {

            char period[21];



            snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);



            av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);

            av_opt_set(oc->priv_data, "sdt_period", period, 0);

            av_opt_set(oc->priv_data, "pat_period", period, 0);

        }

    }



    if (vs->vtt_basename) {

        err = avformat_write_header(vtt_oc,NULL);

        if (err < 0)

            return err;

    }



    return 0;

fail:

    av_dict_free(&options);



    return err;

}

static int hls_start(AVFormatContext *s, VariantStream *vs)

{

    HLSContext *c = s->priv_data;

    AVFormatContext *oc = vs->avf;

    AVFormatContext *vtt_oc = vs->vtt_avf;

    AVDictionary *options = NULL;

    char *filename, iv_string[KEYSIZE*2 + 1];

    int err = 0;



    if (c->flags & HLS_SINGLE_FILE) {

        av_strlcpy(oc->filename, vs->basename,

                   sizeof(oc->filename));

        if (vs->vtt_basename)

            av_strlcpy(vtt_oc->filename, vs->vtt_basename,

                  sizeof(vtt_oc->filename));

    } else if (c->max_seg_size > 0) {

        if (replace_int_data_in_filename(oc->filename, sizeof(oc->filename),

#if FF_API_HLS_WRAP

            vs->basename, 'd', c->wrap ? vs->sequence % c->wrap : vs->sequence) < 1) {

#else

            vs->basename, 'd', vs->sequence) < 1) {

#endif

                av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s', you can try to use -use_localtime 1 with it\n", vs->basename);

                return AVERROR(EINVAL);

        }

    } else {

        if (c->use_localtime) {

            time_t now0;

            struct tm *tm, tmpbuf;

            time(&now0);

            tm = localtime_r(&now0, &tmpbuf);

            if (!strftime(oc->filename, sizeof(oc->filename), vs->basename, tm)) {

                av_log(oc, AV_LOG_ERROR, "Could not get segment filename with use_localtime\n");

                return AVERROR(EINVAL);

            }



            err = sls_flag_use_localtime_filename(oc, c, vs);

            if (err < 0) {

                return AVERROR(ENOMEM);

            }



            if (c->use_localtime_mkdir) {

                const char *dir;

                char *fn_copy = av_strdup(oc->filename);

                if (!fn_copy) {

                    return AVERROR(ENOMEM);

                }

                dir = av_dirname(fn_copy);

                if (mkdir_p(dir) == -1 && errno != EEXIST) {

                    av_log(oc, AV_LOG_ERROR, "Could not create directory %s with use_localtime_mkdir\n", dir);

                    av_free(fn_copy);

                    return AVERROR(errno);

                }

                av_free(fn_copy);

            }

        } else if (replace_int_data_in_filename(oc->filename, sizeof(oc->filename),

#if FF_API_HLS_WRAP

                   vs->basename, 'd', c->wrap ? vs->sequence % c->wrap : vs->sequence) < 1) {

#else

                   vs->basename, 'd', vs->sequence) < 1) {

#endif

            av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s' you can try to use -use_localtime 1 with it\n", vs->basename);

            return AVERROR(EINVAL);

        }

        if( vs->vtt_basename) {

            if (replace_int_data_in_filename(vtt_oc->filename, sizeof(vtt_oc->filename),

#if FF_API_HLS_WRAP

                vs->vtt_basename, 'd', c->wrap ? vs->sequence % c->wrap : vs->sequence) < 1) {

#else

                vs->vtt_basename, 'd', vs->sequence) < 1) {

#endif

                av_log(vtt_oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n", vs->vtt_basename);

                return AVERROR(EINVAL);

            }

       }

    }

    vs->number++;



    set_http_options(s, &options, c);



    if (c->flags & HLS_TEMP_FILE) {

        av_strlcat(oc->filename, ".tmp", sizeof(oc->filename));

    }



    if (c->key_info_file || c->encrypt) {

        if (c->key_info_file && c->encrypt) {

            av_log(s, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"

                  " will use -hls_key_info_file priority\n");

        }



        if (!c->encrypt_started || (c->flags & HLS_PERIODIC_REKEY)) {

            if (c->key_info_file) {

                if ((err = hls_encryption_start(s)) < 0)

                    goto fail;

            } else {

                if ((err = do_encrypt(s, vs)) < 0)

                    goto fail;

            }

            c->encrypt_started = 1;

        }

        if ((err = av_dict_set(&options, "encryption_key", c->key_string, 0))

                < 0)

            goto fail;

        err = av_strlcpy(iv_string, c->iv_string, sizeof(iv_string));

        if (!err)

            snprintf(iv_string, sizeof(iv_string), "%032"PRIx64, vs->sequence);

        if ((err = av_dict_set(&options, "encryption_iv", iv_string, 0)) < 0)

           goto fail;



        filename = av_asprintf("crypto:%s", oc->filename);

        if (!filename) {

            err = AVERROR(ENOMEM);

            goto fail;

        }

        err = hlsenc_io_open(s, &oc->pb, filename, &options);

        av_free(filename);

        av_dict_free(&options);

        if (err < 0)

            return err;

    } else if (c->segment_type != SEGMENT_TYPE_FMP4) {

        if ((err = hlsenc_io_open(s, &oc->pb, oc->filename, &options)) < 0)

            goto fail;

    }

    if (vs->vtt_basename) {

        set_http_options(s, &options, c);

        if ((err = hlsenc_io_open(s, &vtt_oc->pb, vtt_oc->filename, &options)) < 0)

            goto fail;

    }

    av_dict_free(&options);



    if (c->segment_type != SEGMENT_TYPE_FMP4) {

        

        if (oc->oformat->priv_class && oc->priv_data) {

            char period[21];



            snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);



            av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);

            av_opt_set(oc->priv_data, "sdt_period", period, 0);

            av_opt_set(oc->priv_data, "pat_period", period, 0);

        }

    }



    if (vs->vtt_basename) {

        err = avformat_write_header(vtt_oc,NULL);

        if (err < 0)

            return err;

    }



    return 0;

fail:

    av_dict_free(&options);



    return err;

}

static int FUNC_0(AVFormatContext *VAR_0, VariantStream *VAR_1)

{

    HLSContext *c = VAR_0->priv_data;

    AVFormatContext *oc = VAR_1->avf;

    AVFormatContext *vtt_oc = VAR_1->vtt_avf;

    AVDictionary *options = NULL;

    char *VAR_2, iv_string[KEYSIZE*2 + 1];

    int VAR_3 = 0;



    if (c->flags & HLS_SINGLE_FILE) {

        av_strlcpy(oc->VAR_2, VAR_1->basename,

                   sizeof(oc->VAR_2));

        if (VAR_1->vtt_basename)

            av_strlcpy(vtt_oc->VAR_2, VAR_1->vtt_basename,

                  sizeof(vtt_oc->VAR_2));

    } else if (c->max_seg_size > 0) {

        if (replace_int_data_in_filename(oc->VAR_2, sizeof(oc->VAR_2),

#if FF_API_HLS_WRAP

            VAR_1->basename, 'd', c->wrap ? VAR_1->sequence % c->wrap : VAR_1->sequence) < 1) {

#else

            VAR_1->basename, 'd', VAR_1->sequence) < 1) {

#endif

                av_log(oc, AV_LOG_ERROR, "Invalid segment VAR_2 template '%VAR_0', you can try to use -use_localtime 1 with it\n", VAR_1->basename);

                return AVERROR(EINVAL);

        }

    } else {

        if (c->use_localtime) {

            time_t now0;

            struct VAR_4 *VAR_4, VAR_5;

            time(&now0);

            VAR_4 = localtime_r(&now0, &VAR_5);

            if (!strftime(oc->VAR_2, sizeof(oc->VAR_2), VAR_1->basename, VAR_4)) {

                av_log(oc, AV_LOG_ERROR, "Could not get segment VAR_2 with use_localtime\n");

                return AVERROR(EINVAL);

            }



            VAR_3 = sls_flag_use_localtime_filename(oc, c, VAR_1);

            if (VAR_3 < 0) {

                return AVERROR(ENOMEM);

            }



            if (c->use_localtime_mkdir) {

                const char *VAR_6;

                char *VAR_7 = av_strdup(oc->VAR_2);

                if (!VAR_7) {

                    return AVERROR(ENOMEM);

                }

                VAR_6 = av_dirname(VAR_7);

                if (mkdir_p(VAR_6) == -1 && errno != EEXIST) {

                    av_log(oc, AV_LOG_ERROR, "Could not create directory %VAR_0 with use_localtime_mkdir\n", VAR_6);

                    av_free(VAR_7);

                    return AVERROR(errno);

                }

                av_free(VAR_7);

            }

        } else if (replace_int_data_in_filename(oc->VAR_2, sizeof(oc->VAR_2),

#if FF_API_HLS_WRAP

                   VAR_1->basename, 'd', c->wrap ? VAR_1->sequence % c->wrap : VAR_1->sequence) < 1) {

#else

                   VAR_1->basename, 'd', VAR_1->sequence) < 1) {

#endif

            av_log(oc, AV_LOG_ERROR, "Invalid segment VAR_2 template '%VAR_0' you can try to use -use_localtime 1 with it\n", VAR_1->basename);

            return AVERROR(EINVAL);

        }

        if( VAR_1->vtt_basename) {

            if (replace_int_data_in_filename(vtt_oc->VAR_2, sizeof(vtt_oc->VAR_2),

#if FF_API_HLS_WRAP

                VAR_1->vtt_basename, 'd', c->wrap ? VAR_1->sequence % c->wrap : VAR_1->sequence) < 1) {

#else

                VAR_1->vtt_basename, 'd', VAR_1->sequence) < 1) {

#endif

                av_log(vtt_oc, AV_LOG_ERROR, "Invalid segment VAR_2 template '%VAR_0'\n", VAR_1->vtt_basename);

                return AVERROR(EINVAL);

            }

       }

    }

    VAR_1->number++;



    set_http_options(VAR_0, &options, c);



    if (c->flags & HLS_TEMP_FILE) {

        av_strlcat(oc->VAR_2, ".tmp", sizeof(oc->VAR_2));

    }



    if (c->key_info_file || c->encrypt) {

        if (c->key_info_file && c->encrypt) {

            av_log(VAR_0, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"

                  " will use -hls_key_info_file priority\n");

        }



        if (!c->encrypt_started || (c->flags & HLS_PERIODIC_REKEY)) {

            if (c->key_info_file) {

                if ((VAR_3 = hls_encryption_start(VAR_0)) < 0)

                    goto fail;

            } else {

                if ((VAR_3 = do_encrypt(VAR_0, VAR_1)) < 0)

                    goto fail;

            }

            c->encrypt_started = 1;

        }

        if ((VAR_3 = av_dict_set(&options, "encryption_key", c->key_string, 0))

                < 0)

            goto fail;

        VAR_3 = av_strlcpy(iv_string, c->iv_string, sizeof(iv_string));

        if (!VAR_3)

            snprintf(iv_string, sizeof(iv_string), "%032"PRIx64, VAR_1->sequence);

        if ((VAR_3 = av_dict_set(&options, "encryption_iv", iv_string, 0)) < 0)

           goto fail;



        VAR_2 = av_asprintf("crypto:%VAR_0", oc->VAR_2);

        if (!VAR_2) {

            VAR_3 = AVERROR(ENOMEM);

            goto fail;

        }

        VAR_3 = hlsenc_io_open(VAR_0, &oc->pb, VAR_2, &options);

        av_free(VAR_2);

        av_dict_free(&options);

        if (VAR_3 < 0)

            return VAR_3;

    } else if (c->segment_type != SEGMENT_TYPE_FMP4) {

        if ((VAR_3 = hlsenc_io_open(VAR_0, &oc->pb, oc->VAR_2, &options)) < 0)

            goto fail;

    }

    if (VAR_1->vtt_basename) {

        set_http_options(VAR_0, &options, c);

        if ((VAR_3 = hlsenc_io_open(VAR_0, &vtt_oc->pb, vtt_oc->VAR_2, &options)) < 0)

            goto fail;

    }

    av_dict_free(&options);



    if (c->segment_type != SEGMENT_TYPE_FMP4) {

        

        if (oc->oformat->priv_class && oc->priv_data) {

            char VAR_8[21];



            snprintf(VAR_8, sizeof(VAR_8), "%d", (INT_MAX / 2) - 1);



            av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);

            av_opt_set(oc->priv_data, "sdt_period", VAR_8, 0);

            av_opt_set(oc->priv_data, "pat_period", VAR_8, 0);

        }

    }



    if (VAR_1->vtt_basename) {

        VAR_3 = avformat_write_header(vtt_oc,NULL);

        if (VAR_3 < 0)

            return VAR_3;

    }



    return 0;

fail:

    av_dict_free(&options);



    return VAR_3;

}

static int FUNC_0(AVFormatContext *VAR_0, VariantStream *VAR_1)
{ HLSContext *c = VAR_0->priv_data; AVFormatContext *oc = VAR_1->avf; AVFormatContext *vtt_oc = VAR_1->vtt_avf; AVDictionary *options = NULL; char *VAR_2, iv_string[KEYSIZE*2 + 1]; int VAR_3 = 0; if (c->flags & HLS_SINGLE_FILE) { av_strlcpy(oc->VAR_2, VAR_1->basename,
sizeof(oc->VAR_2)); if (VAR_1->vtt_basename)
av_strlcpy(vtt_oc->VAR_2, VAR_1->vtt_basename,
sizeof(vtt_oc->VAR_2)); } else if (c->max_seg_size > 0) { if (replace_int_data_in_filename(oc->VAR_2, sizeof(oc->VAR_2),
#if FF_API_HLS_WRAP
VAR_1->basename, 'd', c->wrap ? VAR_1->sequence % c->wrap : VAR_1->sequence) < 1) { #else
VAR_1->basename, 'd', VAR_1->sequence) < 1) { #endif
av_log(oc, AV_LOG_ERROR, "Invalid segment VAR_2 template '%VAR_0', you can try to use -use_localtime 1 with it\n", VAR_1->basename); return AVERROR(EINVAL); } } else { if (c->use_localtime) { time_t now0; struct VAR_4 *VAR_4, VAR_5; time(&now0); VAR_4 = localtime_r(&now0, &VAR_5); if (!strftime(oc->VAR_2, sizeof(oc->VAR_2), VAR_1->basename, VAR_4)) { av_log(oc, AV_LOG_ERROR, "Could not get segment VAR_2 with use_localtime\n"); return AVERROR(EINVAL); } VAR_3 = sls_flag_use_localtime_filename(oc, c, VAR_1); if (VAR_3 < 0) { return AVERROR(ENOMEM); } if (c->use_localtime_mkdir) { const char *VAR_6; char *VAR_7 = av_strdup(oc->VAR_2); if (!VAR_7) { return AVERROR(ENOMEM); } VAR_6 = av_dirname(VAR_7); if (mkdir_p(VAR_6) == -1 && errno != EEXIST) { av_log(oc, AV_LOG_ERROR, "Could not create directory %VAR_0 with use_localtime_mkdir\n", VAR_6); av_free(VAR_7); return AVERROR(errno); } av_free(VAR_7); } } else if (replace_int_data_in_filename(oc->VAR_2, sizeof(oc->VAR_2), #if FF_API_HLS_WRAP
VAR_1->basename, 'd', c->wrap ? VAR_1->sequence % c->wrap : VAR_1->sequence) < 1) { #else
VAR_1->basename, 'd', VAR_1->sequence) < 1) { #endif
av_log(oc, AV_LOG_ERROR, "Invalid segment VAR_2 template '%VAR_0' you can try to use -use_localtime 1 with it\n", VAR_1->basename); return AVERROR(EINVAL); } if( VAR_1->vtt_basename) { if (replace_int_data_in_filename(vtt_oc->VAR_2, sizeof(vtt_oc->VAR_2),
#if FF_API_HLS_WRAP
VAR_1->vtt_basename, 'd', c->wrap ? VAR_1->sequence % c->wrap : VAR_1->sequence) < 1) { #else
VAR_1->vtt_basename, 'd', VAR_1->sequence) < 1) { #endif
av_log(vtt_oc, AV_LOG_ERROR, "Invalid segment VAR_2 template '%VAR_0'\n", VAR_1->vtt_basename); return AVERROR(EINVAL); } } } VAR_1->number++; set_http_options(VAR_0, &options, c); if (c->flags & HLS_TEMP_FILE) { av_strlcat(oc->VAR_2, ".tmp", sizeof(oc->VAR_2)); } if (c->key_info_file || c->encrypt) { if (c->key_info_file && c->encrypt) { av_log(VAR_0, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"
" will use -hls_key_info_file priority\n"); } if (!c->encrypt_started || (c->flags & HLS_PERIODIC_REKEY)) { if (c->key_info_file) { if ((VAR_3 = hls_encryption_start(VAR_0)) < 0)
goto fail; } else { if ((VAR_3 = do_encrypt(VAR_0, VAR_1)) < 0)
goto fail; } c->encrypt_started = 1; } if ((VAR_3 = av_dict_set(&options, "encryption_key", c->key_string, 0))
< 0)
goto fail; VAR_3 = av_strlcpy(iv_string, c->iv_string, sizeof(iv_string)); if (!VAR_3)
snprintf(iv_string, sizeof(iv_string), "%032"PRIx64, VAR_1->sequence); if ((VAR_3 = av_dict_set(&options, "encryption_iv", iv_string, 0)) < 0)
goto fail; VAR_2 = av_asprintf("crypto:%VAR_0", oc->VAR_2); if (!VAR_2) { VAR_3 = AVERROR(ENOMEM); goto fail; } VAR_3 = hlsenc_io_open(VAR_0, &oc->pb, VAR_2, &options); av_free(VAR_2); av_dict_free(&options); if (VAR_3 < 0)
return VAR_3; } else if (c->segment_type != SEGMENT_TYPE_FMP4) { if ((VAR_3 = hlsenc_io_open(VAR_0, &oc->pb, oc->VAR_2, &options)) < 0)
goto fail; } if (VAR_1->vtt_basename) { set_http_options(VAR_0, &options, c); if ((VAR_3 = hlsenc_io_open(VAR_0, &vtt_oc->pb, vtt_oc->VAR_2, &options)) < 0)
goto fail; } av_dict_free(&options); if (c->segment_type != SEGMENT_TYPE_FMP4) { if (oc->oformat->priv_class && oc->priv_data) { char VAR_8[21]; snprintf(VAR_8, sizeof(VAR_8), "%d", (INT_MAX / 2) - 1); av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0); av_opt_set(oc->priv_data, "sdt_period", VAR_8, 0); av_opt_set(oc->priv_data, "pat_period", VAR_8, 0); } } if (VAR_1->vtt_basename) { VAR_3 = avformat_write_header(vtt_oc,NULL); if (VAR_3 < 0)
return VAR_3; } return 0; fail:
av_dict_free(&options); return VAR_3; }