Decoder viddec;
Decoder subdec;
- int viddec_width;
- int viddec_height;
-
int audio_stream;
int av_sync_type;
if (got_frame) {
if (decoder_reorder_pts == -1) {
frame->pts = av_frame_get_best_effort_timestamp(frame);
- } else if (decoder_reorder_pts) {
- frame->pts = frame->pkt_pts;
- } else {
+ } else if (!decoder_reorder_pts) {
frame->pts = frame->pkt_dts;
}
}
if (got_frame) {
AVRational tb = (AVRational){1, frame->sample_rate};
if (frame->pts != AV_NOPTS_VALUE)
- frame->pts = av_rescale_q(frame->pts, d->avctx->time_base, tb);
- else if (frame->pkt_pts != AV_NOPTS_VALUE)
- frame->pts = av_rescale_q(frame->pkt_pts, av_codec_get_pkt_timebase(d->avctx), tb);
+ frame->pts = av_rescale_q(frame->pts, av_codec_get_pkt_timebase(d->avctx), tb);
else if (d->next_pts != AV_NOPTS_VALUE)
frame->pts = av_rescale_q(d->next_pts, d->next_pts_tb, tb);
if (frame->pts != AV_NOPTS_VALUE) {
frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame);
- is->viddec_width = frame->width;
- is->viddec_height = frame->height;
-
if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) {
if (frame->pts != AV_NOPTS_VALUE) {
double diff = dpts - get_master_clock(is);
static int subtitle_thread(void *arg)
{
VideoState *is = arg;
- AVCodecParameters *codecpar = is->subtitle_st->codecpar;
Frame *sp;
int got_subtitle;
double pts;
pts = sp->sub.pts / (double)AV_TIME_BASE;
sp->pts = pts;
sp->serial = is->subdec.pkt_serial;
- sp->width = codecpar->width;
- sp->height = codecpar->height;
+ sp->width = is->subdec.avctx->width;
+ sp->height = is->subdec.avctx->height;
sp->uploaded = 0;
/* now we can update the picture count */
is->video_stream = stream_index;
is->video_st = ic->streams[stream_index];
- is->viddec_width = avctx->width;
- is->viddec_height = avctx->height;
-
decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread);
if ((ret = decoder_start(&is->viddec, video_thread, is)) < 0)
goto out;