X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsegment.c;h=80716bcf902c69e7909c254e7169f241f9ec07ac;hb=33789862aa5b0afa037c52185462ad7ef8ab33c9;hp=d6c6e58ad2a4fed7e94e19dd3b453b591cd4cd0c;hpb=dbd117240a8b0e905b4906e93c633976843123e9;p=ffmpeg diff --git a/libavformat/segment.c b/libavformat/segment.c index d6c6e58ad2a..80716bcf902 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -99,8 +99,8 @@ static int seg_write_header(AVFormatContext *s) if (!seg->path) { char *t; seg->path = av_strdup(s->filename); - t = rindex(seg->path, '.'); - if (t) t = '\0'; + 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(path ),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 }, };