}
if (priv->vidx >= 0) {
+ s = priv->fmt_ctx->streams[priv->vidx];
+
ret = _video_init(priv);
if (ret < 0)
goto error;
io->width = priv->vcodec_ctx->width;
io->height = priv->vcodec_ctx->height;
io->pix_fmt = priv->vcodec_ctx->pix_fmt;
- io->frame_rate = priv-> fmt_ctx->streams[priv->vidx]->r_frame_rate;
+ io->frame_rate.num = s->r_frame_rate.den;
+ io->frame_rate.den = s->r_frame_rate.num;
io->sample_aspect_ratio = priv->vcodec_ctx->sample_aspect_ratio;
io->x = 0;
io->y = 0;
io->vopen = 1;
+
+ scf_loge("io->frame_rate: %d:%d\n", io->frame_rate.num, io->frame_rate.den);
}
if (priv->aidx >= 0) {
io->sample_rate = priv->acodec_ctx->time_base;
io->channels = priv->acodec_ctx->channels;
io->aopen = 1;
+
+ scf_loge("io->sample_rate: %d:%d\n", io->sample_rate.num, io->sample_rate.den);
}
io->priv = priv;
if (nb_vframes) {
(*nb_vframes)++;
- io->frame_rate.num = s->r_frame_rate.den;
- io->frame_rate.den = s->r_frame_rate.num;
-
f->frame->pts = f->frame->pts * av_q2d(s->time_base) / av_q2d(io->frame_rate);
- scf_logd("frame->pts: %ld, stream_index: %d, s->r_frame_rate: %d:%d, s->time_base: %d:%d\n",
+ scf_logi("frame->pts: %ld, stream_index: %d, io->frame_rate: %d:%d, s->time_base: %d:%d\n",
frame->pts, pkt->stream_index,
- s->r_frame_rate.num, s->r_frame_rate.den,
+ io->frame_rate.num, io->frame_rate.den,
s->time_base.num, s->time_base.den);
} else {
- io->sample_rate = s->time_base;
+ f->frame->pts = f->frame->pts * av_q2d(s->time_base) / av_q2d(io->sample_rate);
- scf_logd("frame->pts: %ld, stream_index: %d, s->time_base: %d:%d\n",
+ scf_logi("frame->pts: %ld, stream_index: %d, io->sample_rate: %d:%d, s->time_base: %d:%d\n",
frame->pts, pkt->stream_index,
+ io->sample_rate.num, io->sample_rate.den,
s->time_base.num, s->time_base.den);
}