Commit a9d97e1b authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: use av_rescale_delta() on the audio filter input

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8766ad9e
......@@ -1525,8 +1525,8 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
decoded_frame_tb = AV_TIME_BASE_Q;
}
if (decoded_frame->pts != AV_NOPTS_VALUE)
decoded_frame->pts = av_rescale_q(decoded_frame->pts,
decoded_frame_tb,
decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts,
(AVRational){1, ist->st->codec->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last,
(AVRational){1, ist->st->codec->sample_rate});
for (i = 0; i < ist->nb_filters; i++)
av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame,
......
......@@ -217,6 +217,9 @@ typedef struct InputStream {
int64_t next_pts; ///< synthetic pts for the next decode frame (in AV_TIME_BASE units)
int64_t pts; ///< current pts of the decoded frame (in AV_TIME_BASE units)
int wrap_correction_done;
int64_t filter_in_rescale_delta_last;
double ts_scale;
int is_start; /* is 1 at the start and after a discontinuity */
int saw_first_ts;
......
......@@ -586,6 +586,8 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
ist->reinit_filters = -1;
MATCH_PER_STREAM_OPT(reinit_filters, i, ist->reinit_filters, ic, st);
ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
switch (dec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
if(!ist->dec)
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,7 @@ c53c9f7ee2091405fbe50374f9055679 *./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0x17ce1069
14d0ac1513840b670a785daf4331aca8 *./tests/data/lavf/lavf.mxf
554553 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0xa3c0dbc4
./tests/data/lavf/lavf.mxf CRC=0xe11bdbc4
5636cee18b0f34a5acb33a8efb9f80c6 *./tests/data/lavf/lavf.mxf
525369 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0x17ce1069
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment