lavf/segment: use AV_OPT_TIME_DURATION for time_delta

Simplify.
pull/27/head
Stefano Sabatini 12 years ago
parent 459dc81a64
commit 71a2e5245c
  1. 12
      libavformat/segment.c

@ -86,7 +86,6 @@ typedef struct {
int nb_frames; ///< number of elments in the frames array
int frame_count;
char *time_delta_str; ///< approximation value duration used for the segment times
int64_t time_delta;
int individual_header_trailer; /**< Set by a private option. */
int write_header_trailer; /**< Set by a private option. */
@ -556,15 +555,6 @@ static int seg_write_header(AVFormatContext *s)
}
}
if (seg->time_delta_str) {
if ((ret = av_parse_time(&seg->time_delta, seg->time_delta_str, 1)) < 0) {
av_log(s, AV_LOG_ERROR,
"Invalid time duration specification '%s' for delta option\n",
seg->time_delta_str);
return ret;
}
}
if (seg->list) {
if (seg->list_type == LIST_TYPE_UNDEFINED) {
if (av_match_ext(seg->list, "csv" )) seg->list_type = LIST_TYPE_CSV;
@ -786,7 +776,7 @@ static const AVOption options[] = {
{ "hls", "Apple HTTP Live Streaming compatible", 0, AV_OPT_TYPE_CONST, {.i64=LIST_TYPE_M3U8 }, INT_MIN, INT_MAX, E, "list_type" },
{ "segment_time", "set segment duration", OFFSET(time_str),AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
{ "segment_time_delta","set approximation value used for the segment times", OFFSET(time_delta_str), AV_OPT_TYPE_STRING, {.str = "0"}, 0, 0, E },
{ "segment_time_delta","set approximation value used for the segment times", OFFSET(time_delta), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, 0, E },
{ "segment_times", "set segment split time points", OFFSET(times_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E },
{ "segment_frames", "set segment split frame numbers", OFFSET(frames_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E },
{ "segment_wrap", "set number after which the index wraps", OFFSET(segment_idx_wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },

Loading…
Cancel
Save