主要也就是修改了:
ijkmedia>ijkplayer>ff_ffplay.c这个文件
static double vp_duration(VideoState *is, Frame *vp, Frame *nextvp) {
if(vp->serial == nextvp->serial) {
doubleduration = nextvp->pts - vp->pts;
if(isnan(duration) || duration <=0|| duration > is->max_frame_duration)
return vp->duration;
else
return duration;
}else{
return 0.0;
}
}
直接换成:
static double vp_duration(VideoState*is,Frame*vp,Frame*nextvp) {
return vp->duration;
}
接着改staticintffplay_video_thread这个方法:
static int ffplay_video_thread(void*arg){
FFPlayer*ffp = arg;
VideoState*is = ffp->is;
AVFrame*frame =av_frame_alloc();
doublepts;
doubleduration;
intret;
AVRationaltb = is->video_st->time_base;
//注释掉
//AVRational frame_rate = av_guess_frame_rate(is->ic, is->video_st, NULL);
//......中间代码太长,不贴上了
//注释掉
//duration = (frame_rate.num && frame_rate.den ? av_q2d((AVRational) {frame_rate.den, frame_rate.num}) : 0);
//直接写出
duration=0.01;
//........
}