X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsegment.c;h=80716bcf902c69e7909c254e7169f241f9ec07ac;hb=c12e1bd1bc7f0dd0dae2937d7f8c564e887c84ff;hp=91905cf35fcbfcb3b934df4670e9e02c7b288eff;hpb=13c99587511bfc35acf3b9427ef4d48ae5aec312;p=ffmpeg diff --git a/libavformat/segment.c b/libavformat/segment.c index 91905cf35fc..80716bcf902 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -98,9 +98,9 @@ static int seg_write_header(AVFormatContext *s) if (!seg->path) { char *t; - seg->path = strdup(s->filename); - t = rindex(seg->path, '.'); - if (t) t = '\0'; + seg->path = av_strdup(s->filename); + t = strrchr(seg->path, '.'); + if (t) *t = '\0'; } oc = avformat_alloc_context(); @@ -189,10 +189,10 @@ static int seg_write_trailer(struct AVFormatContext *s) #define OFFSET(x) offsetof(SegmentContext, x) #define E AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { - { "container_format", "container format used for the segments", OFFSET(format), FF_OPT_TYPE_STRING, {.str = "nut"}, 0, 0, E }, - { "segment_time", "segment lenght in seconds", OFFSET(time), FF_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E }, - { "segment_pattern", "pattern to use in segment files", OFFSET(pattern),FF_OPT_TYPE_STRING, {.str = "%03d"}, 0, 0, E }, - { "segment_basename", "basename to use in segment files", OFFSET(pattern),FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, + { "container_format", "container format used for the segments", OFFSET(format), AV_OPT_TYPE_STRING, {.str = "nut"}, 0, 0, E }, + { "segment_time", "segment lenght in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E }, + { "segment_pattern", "pattern to use in segment files", OFFSET(pattern),AV_OPT_TYPE_STRING, {.str = "%03d"}, 0, 0, E }, + { "segment_basename", "basename to use in segment files", OFFSET(path ),AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, { NULL }, };