summaryrefslogtreecommitdiff
authorMichael Niedermayer <michaelni@gmx.at>2013-10-09 14:28:51 (GMT)
committer Michael Niedermayer <michaelni@gmx.at>2013-10-09 14:33:18 (GMT)
commit0f322feffdf25fee55ab3925c09d27dd6452cf96 (patch)
treed17c00eeb20e53bc891a9519b72e4f69299b3d16
parent8780f7fbfaacb1f31d9915a368850f23557bc0d5 (diff)
downloadffmpeg-0f322feffdf25fee55ab3925c09d27dd6452cf96.zip
ffmpeg-0f322feffdf25fee55ab3925c09d27dd6452cf96.tar.gz
ffmpeg-0f322feffdf25fee55ab3925c09d27dd6452cf96.tar.bz2
avfilter/buffersink: try to fix AV_NOPTS_VALUE
no testcase available, just found this issue by reading the code Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat
-rw-r--r--libavfilter/buffersink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index 6dca209..df1cb65 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -167,8 +167,9 @@ static int read_from_fifo(AVFilterContext *ctx, AVFrame *frame,
av_audio_fifo_read(s->audio_fifo, (void**)tmp->extended_data, nb_samples);
tmp->pts = s->next_pts;
- s->next_pts += av_rescale_q(nb_samples, (AVRational){1, link->sample_rate},
- link->time_base);
+ if (s->next_pts != AV_NOPTS_VALUE)
+ s->next_pts += av_rescale_q(nb_samples, (AVRational){1, link->sample_rate},
+ link->time_base);
av_frame_move_ref(frame, tmp);
av_frame_free(&tmp);
@@ -252,6 +253,7 @@ static av_cold int common_init(AVFilterContext *ctx)
return AVERROR(ENOMEM);
}
buf->warning_limit = 100;
+ buf->next_pts = AV_NOPTS_VALUE;
return 0;
}