From: yu.dongliang <18588496441@163.com> Date: Wed, 12 Apr 2023 07:25:34 +0000 (+0800) Subject: tmp input X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=d173f3708edbd2909b0838dca61a7d29fff63914;p=simplay.git tmp input --- diff --git a/simp_ffmpeg_input.c b/simp_ffmpeg_input.c index baa55ee..f28b7fa 100644 --- a/simp_ffmpeg_input.c +++ b/simp_ffmpeg_input.c @@ -255,17 +255,21 @@ static int __ffmpeg_decode(simp_avio_t* io, AVCodecContext* dec_ctx, AVPacket* p if (nb_vframes) { (*nb_vframes)++; + int64_t pts = f->frame->pts; + f->frame->pts = f->frame->pts * av_q2d(s->time_base) / av_q2d(io->frame_rate); - scf_logi("frame->pts: %ld, stream_index: %d, io->frame_rate: %d:%d, s->time_base: %d:%d\n", - frame->pts, pkt->stream_index, + scf_logd("f->frame->pts: %ld, pts: %ld, stream_index: %d, io->frame_rate: %d:%d, s->time_base: %d:%d\n", + f->frame->pts, pts, pkt->stream_index, io->frame_rate.num, io->frame_rate.den, s->time_base.num, s->time_base.den); } else { + int64_t pts = f->frame->pts; + f->frame->pts = f->frame->pts * av_q2d(s->time_base) / av_q2d(io->sample_rate); - scf_logi("frame->pts: %ld, stream_index: %d, io->sample_rate: %d:%d, s->time_base: %d:%d\n", - frame->pts, pkt->stream_index, + scf_logd("f->frame->pts: %ld, pts: %ld, stream_index: %d, io->sample_rate: %d:%d, s->time_base: %d:%d\n", + f->frame->pts, pts, pkt->stream_index, io->sample_rate.num, io->sample_rate.den, s->time_base.num, s->time_base.den); }