static int decoder_reorder_pts= -1;
static int autoexit;
static int framedrop=1;
+
+static int rdftspeed=20;
#if CONFIG_AVFILTER
static char *vfilters = NULL;
#endif
is->refresh=1;
SDL_PushEvent(&event);
}
- usleep(5000); //FIXME ideally we should wait the correct time but SDLs event passing is so slow it would be silly
+ usleep(is->audio_st && is->show_audio ? rdftspeed*1000 : 5000); //FIXME ideally we should wait the correct time but SDLs event passing is so slow it would be silly
}
return 0;
}
av_diff = 0;
if (is->audio_st && is->video_st)
av_diff = get_audio_clock(is) - get_video_clock(is);
- printf("%7.2f A-V:%7.3f aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r",
- get_master_clock(is), av_diff, aqsize / 1024, vqsize / 1024, sqsize, is->faulty_dts, is->faulty_pts);
+ printf("%7.2f A-V:%7.3f s:%3.1f aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r",
+ get_master_clock(is), av_diff, FFMAX(is->skip_frames-1, 0), aqsize / 1024, vqsize / 1024, sqsize, is->faulty_dts, is->faulty_pts);
fflush(stdout);
last_time = cur_time;
}
av_free_packet(&pkt);
picref->pts = pts;
+ picref->pos = pkt.pos;
picref->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
avfilter_start_frame(link, avfilter_ref_pic(picref, ~0));
avfilter_draw_slice(link, 0, link->h, 1);
}
static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
- int64_t *pts)
+ int64_t *pts, int64_t *pos)
{
AVFilterPicRef *pic;
frame->opaque = pic;
*pts = pic->pts;
+ *pos = pic->pos;
memcpy(frame->data, pic->data, sizeof(frame->data));
memcpy(frame->linesize, pic->linesize, sizeof(frame->linesize));
{
VideoState *is = arg;
AVFrame *frame= avcodec_alloc_frame();
- int64_t pts_int;
+ int64_t pts_int, pos;
double pts;
int ret;
while (is->paused && !is->videoq.abort_request)
SDL_Delay(10);
#if CONFIG_AVFILTER
- ret = get_filtered_video_frame(filt_out, frame, &pts_int);
+ ret = get_filtered_video_frame(filt_out, frame, &pts_int, &pos);
#else
ret = get_video_frame(is, frame, &pts_int, &pkt);
#endif
pts = pts_int*av_q2d(is->video_st->time_base);
#if CONFIG_AVFILTER
- ret = output_picture2(is, frame, pts, -1); /* fixme: unknown pos */
+ ret = output_picture2(is, frame, pts, pos);
#else
ret = output_picture2(is, frame, pts, pkt.pos);
av_free_packet(&pkt);
#if CONFIG_AVFILTER
{ "vfilters", OPT_STRING | HAS_ARG, {(void*)&vfilters}, "video filters", "filter list" },
#endif
+ { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, {(void*)&rdftspeed}, "rdft speed", "msecs" },
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
{ NULL, },
};