static int opt_streamid(OptionsContext *o, const char *opt, const char *arg)
{
    int idx;
    char *p;
    char idx_str[16];
    av_strlcpy(idx_str, arg, sizeof(idx_str));
    p = strchr(idx_str, ':');
    if (!p) {
        av_log(NULL, AV_LOG_FATAL,
               "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
               arg, opt);
        exit_program(1);
    }
    *p++ = '\0';
    idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX);
    o->streamid_map = grow_array(o->streamid_map, sizeof(*o->streamid_map), &o->nb_streamid_map, idx+1);
    o->streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
    return 0;
}
['static int opt_streamid(OptionsContext *o, const char *opt, const char *arg)\n{\n    int idx;\n    char *p;\n    char idx_str[16];\n    av_strlcpy(idx_str, arg, sizeof(idx_str));\n    p = strchr(idx_str, \':\');\n    if (!p) {\n        av_log(NULL, AV_LOG_FATAL,\n               "Invalid value \'%s\' for option \'%s\', required syntax is \'index:value\'\\n",\n               arg, opt);\n        exit_program(1);\n    }\n    *p++ = \'\\0\';\n    idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX);\n    o->streamid_map = grow_array(o->streamid_map, sizeof(*o->streamid_map), &o->nb_streamid_map, idx+1);\n    o->streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);\n    return 0;\n}', 'double parse_number_or_die(const char *context, const char *numstr, int type,\n                           double min, double max)\n{\n    char *tail;\n    const char *error;\n    double d = av_strtod(numstr, &tail);\n    if (*tail)\n        error = "Expected number for %s but found: %s\\n";\n    else if (d < min || d > max)\n        error = "The value for %s was %s which is not within %f - %f\\n";\n    else if (type == OPT_INT64 && (int64_t)d != d)\n        error = "Expected int64 for %s but found %s\\n";\n    else if (type == OPT_INT && (int)d != d)\n        error = "Expected int for %s but found %s\\n";\n    else\n        return d;\n    av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max);\n    exit_program(1);\n    return 0;\n}']