mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avcodec/setts_bsf: add sample rate for expressions
This commit is contained in:
parent
5f0e3b549a
commit
6941d93faa
@ -727,6 +727,9 @@ The previous output PTS.
|
|||||||
|
|
||||||
@item TB
|
@item TB
|
||||||
The timebase of stream packet belongs.
|
The timebase of stream packet belongs.
|
||||||
|
|
||||||
|
@item SR
|
||||||
|
The sample rate of stream packet belongs.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@anchor{text2movsub}
|
@anchor{text2movsub}
|
||||||
|
@ -43,6 +43,7 @@ static const char *const var_names[] = {
|
|||||||
"STARTPTS", ///< PTS at start of movie
|
"STARTPTS", ///< PTS at start of movie
|
||||||
"STARTDTS", ///< DTS at start of movie
|
"STARTDTS", ///< DTS at start of movie
|
||||||
"TB", ///< timebase of the stream
|
"TB", ///< timebase of the stream
|
||||||
|
"SR", ///< sample rate of the stream
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ enum var_name {
|
|||||||
VAR_STARTPTS,
|
VAR_STARTPTS,
|
||||||
VAR_STARTDTS,
|
VAR_STARTDTS,
|
||||||
VAR_TB,
|
VAR_TB,
|
||||||
|
VAR_SR,
|
||||||
VAR_VARS_NB
|
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_STARTPTS] = s->start_pts;
|
||||||
s->var_values[VAR_STARTDTS] = s->start_dts;
|
s->var_values[VAR_STARTDTS] = s->start_dts;
|
||||||
s->var_values[VAR_TB] = av_q2d(ctx->time_base_out);
|
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));
|
new_ts = llrint(av_expr_eval(s->ts_expr, s->var_values, NULL));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user