[Ffmpeg-devel] FFPlay > Closing it in the end

João Eduardo joaoedu
Sun Jun 5 14:12:37 CEST 2005


Hi, I would like to know how to make the FFPlay close, when the movie ends.

I'm using the code above, but it is not working with all video formats 
(like AVI).

    |_*ffplay.c*_

      if (show_status) {
            static int64_t last_time;
            int64_t cur_time;
            int aqsize, vqsize;
            double av_diff;
           
            cur_time = av_gettime();
            if (!last_time || (cur_time - last_time) >= 500 * 1000) {
                aqsize = 0;
                vqsize = 0;
                if (is->audio_st)
                    aqsize = is->audioq.size;
                if (is->video_st)
                    vqsize = is->videoq.size;
                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    \r",
                       get_master_clock(is), av_diff, aqsize / 1024,
    vqsize / 1024);
                fflush(stdout);
                last_time = cur_time;
            if (((vqsize / 1024) < 20) && ((vqsize / 1024) > 0.01) ||
    (av_diff < -0.6)   ) {
            do_exit();
            }
            }
        }
    }

    |


-- 




More information about the ffmpeg-devel mailing list