[Ffmpeg-devel] Ffplay, new function, some problem

Kevin Petiot kevin.petiot
Wed Jul 26 12:26:37 CEST 2006


Hey all,

I develloped a new function for ffplay : step_to_precedent_I_frame, which allow
to go back to the precedent I_frame of a video.

it's work, but sometime, instead of going back to the precedent frame, the
player go the next one or stay on the same frame. And I can't figure where it
come from.
I don't know if it come from my function, or if it's comming from utils.c

For advice :

void step_to_precedent_I_frame(VideoState *is, int64_t pos)
{
    double incr, time;
    int64_t pos1;
    if (is) {
        printf("position depart  : %lld \n", pos);
        is->video_off = 0;
        if (is->paused)
            is->paused=0;
        incr = - av_q2d(is->video_st->codec->time_base) * AV_TIME_BASE;
        pos += incr;
        stream_seek(is, pos, incr );
        printf("position voulue : %lld \n", pos);

/*This part is to avoid sync problem after step by step*/
	if (cur_stream->pause_current_pts_time !=0 ){
                double diff = av_q2d(cur_stream->video_st->codec->time_base);
                cur_stream->pause_current_pts_time =
cur_stream->pause_current_pts_time + incr;
                printf("step_pause_current_pts_time = %lld\n ",
cur_stream->pause_current_pts_time);
        }
        else cur_stream->pause_current_pts_time = av_gettime();
        cur_stream->video_current_pts = get_video_clock(cur_stream);
        printf("\nincr : %lf", incr);
    }
    step = 1;
}




case SDLK_z: //D: Step to precedent I frame
     pos = get_master_clock(cur_stream);
     step_to_precedent_I_frame(cur_stream,(int64_t) (pos * AV_TIME_BASE));
     break;


Maybe someone have a idea, where this bug can come from.

When, it would be fixed, I would be able to start to write a plugin for mozilla,
and then make a contribution for all the code.

Regards,

Kevin




More information about the ffmpeg-devel mailing list