#8573: The output pts of audio filter 'atempo' seems to be wrong.
-----------------------------------+--------------------------------------
             Reporter:  elite_jwp  |                     Type:  defect
               Status:  new        |                 Priority:  normal
            Component:  avfilter   |                  Version:  git-master
             Keywords:  atempo     |               Blocked By:
             Blocking:             |  Reproduced by developer:  0
Analyzed by developer:  0          |
-----------------------------------+--------------------------------------
 At libavfilter/af_atempo.c:1061, the code is as below:
 {{{
     atempo->dst_buffer->pts = atempo->start_pts +
         av_rescale_q(atempo->nsamples_out,
                      (AVRational){ 1, outlink->sample_rate },
                      outlink->time_base);

 }}}
 According to tempo factor, the number of output samples may be different
 with that of input samples, but they are equal in time duration.
 Generally, inlink->sample_rate is same with outlink->sample_rate. So it
 seems that the duration of '''nsamples_out''' can't be computed like above
 code. It should take count of tempo factor, and can be fixed like below?

 {{{
     atempo->dst_buffer->pts = atempo->start_pts +
         av_rescale_q(atempo->nsamples_out,
                      (AVRational){ 1,
 (int)(outlink->sample_rate/atempo->tempo) },
                      outlink->time_base);

 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8573>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to