diff options
Diffstat (limited to 'libavfilter/af_asyncts.c')
-rw-r--r-- | libavfilter/af_asyncts.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c index 7459610af8..1737d6138d 100644 --- a/libavfilter/af_asyncts.c +++ b/libavfilter/af_asyncts.c @@ -49,6 +49,7 @@ static const AVOption asyncts_options[] = { { "min_delta", "Minimum difference between timestamps and audio data " "(in seconds) to trigger padding/trimmin the data.", OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { 0.1 }, 0, INT_MAX, A }, { "max_comp", "Maximum compensation in samples per second.", OFFSET(max_comp), AV_OPT_TYPE_INT, { 500 }, 0, INT_MAX, A }, + { "first_pts", "Assume the first pts should be this value.", OFFSET(pts), AV_OPT_TYPE_INT64, { AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, A }, { NULL }, }; @@ -68,8 +69,6 @@ static int init(AVFilterContext *ctx, const char *args) } av_opt_free(s); - s->pts = AV_NOPTS_VALUE; - return 0; } @@ -182,7 +181,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) if (labs(delta) > s->min_delta) { av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\n", delta); - out_size += delta; + out_size = av_clipl_int32((int64_t)out_size + delta); } else { if (s->resample) { int comp = av_clip(delta, -s->max_comp, s->max_comp); |