[FFmpeg-cvslog] lavf/segment: use AV_OPT_TIME_DURATION for time_delta

Stefano Sabatini git at videolan.org
Thu Jul 11 00:50:21 CEST 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Jul  5 14:33:33 2013 +0200| [71a2e5245ca512cbf1eb748ae7ca53304eb0a7f2] | committer: Stefano Sabatini

lavf/segment: use AV_OPT_TIME_DURATION for time_delta

Simplify.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=71a2e5245ca512cbf1eb748ae7ca53304eb0a7f2
---

 libavformat/segment.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 209d87b..95984bd 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 },



More information about the ffmpeg-cvslog mailing list