avfilter/af_compand: pts init code from libavfilter/af_compand_fork.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -87,6 +87,7 @@ AVFILTER_DEFINE_CLASS(compand);
|
|||||||
static av_cold int init(AVFilterContext *ctx)
|
static av_cold int init(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
CompandContext *s = ctx->priv;
|
CompandContext *s = ctx->priv;
|
||||||
|
s->pts = AV_NOPTS_VALUE;
|
||||||
|
|
||||||
if (!s->attacks || !s->decays || !s->points) {
|
if (!s->attacks || !s->decays || !s->points) {
|
||||||
av_log(ctx, AV_LOG_ERROR, "Missing attacks and/or decays and/or points.\n");
|
av_log(ctx, AV_LOG_ERROR, "Missing attacks and/or decays and/or points.\n");
|
||||||
@@ -223,6 +224,10 @@ static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
|
|||||||
int chan, i, av_uninit(dindex), oindex, av_uninit(count);
|
int chan, i, av_uninit(dindex), oindex, av_uninit(count);
|
||||||
AVFrame *out_frame = NULL;
|
AVFrame *out_frame = NULL;
|
||||||
|
|
||||||
|
if (s->pts == AV_NOPTS_VALUE) {
|
||||||
|
s->pts = (frame->pts == AV_NOPTS_VALUE) ? 0 : frame->pts;
|
||||||
|
}
|
||||||
|
|
||||||
av_assert1(channels > 0); /* would corrupt delay_count and delay_index */
|
av_assert1(channels > 0); /* would corrupt delay_count and delay_index */
|
||||||
|
|
||||||
for (chan = 0; chan < channels; chan++) {
|
for (chan = 0; chan < channels; chan++) {
|
||||||
|
Reference in New Issue
Block a user