diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-02-15 22:51:21 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-02-15 22:52:44 +0300 |
commit | 6941d93faab0e05acbec2bbdd014dc9c26fa0dbe (patch) | |
tree | 8d33076a34199e70c6a0e597a31c58fb69f53b88 /libavcodec/setts_bsf.c | |
parent | 5f0e3b549a26d7dae66dcaf278dd4abf0ba69b07 (diff) |
avcodec/setts_bsf: add sample rate for expressions
Diffstat (limited to 'libavcodec/setts_bsf.c')
-rw-r--r-- | libavcodec/setts_bsf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/setts_bsf.c b/libavcodec/setts_bsf.c index 302f612412..5b6b256915 100644 --- a/libavcodec/setts_bsf.c +++ b/libavcodec/setts_bsf.c @@ -43,6 +43,7 @@ static const char *const var_names[] = { "STARTPTS", ///< PTS at start of movie "STARTDTS", ///< DTS at start of movie "TB", ///< timebase of the stream + "SR", ///< sample rate of the stream NULL }; @@ -59,6 +60,7 @@ enum var_name { VAR_STARTPTS, VAR_STARTDTS, VAR_TB, + VAR_SR, VAR_VARS_NB }; @@ -151,6 +153,7 @@ static int setts_filter(AVBSFContext *ctx, AVPacket *pkt) s->var_values[VAR_STARTPTS] = s->start_pts; s->var_values[VAR_STARTDTS] = s->start_dts; s->var_values[VAR_TB] = av_q2d(ctx->time_base_out); + s->var_values[VAR_SR] = ctx->par_in->sample_rate; new_ts = llrint(av_expr_eval(s->ts_expr, s->var_values, NULL)); |