summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-07-05 14:33:33 +0200
committerStefano Sabatini <stefasab@gmail.com>2013-07-11 00:36:53 +0200
commit71a2e5245ca512cbf1eb748ae7ca53304eb0a7f2 (patch)
tree7b134b4fe828d285ee77833d62a3b24ff84d9b88 /libavformat
parent459dc81a64a3c3fe99d45570a23b897172efc739 (diff)
lavf/segment: use AV_OPT_TIME_DURATION for time_delta
Simplify.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/segment.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 209d87b3e5..95984bd116 100644
--- a/libavformat/segment.c
+++ b/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 },