Revision 6371c81a

View differences:

ffplay.c
2337 2337
                    uint64_t size=  url_fsize(cur_stream->ic->pb);
2338 2338
                    stream_seek(cur_stream, size*(double)event.button.x/(double)cur_stream->width, 0, 1);
2339 2339
                }else{
2340
                int64_t ts;
2341
                int ns, hh, mm, ss;
2342
                int tns, thh, tmm, tss;
2343
                tns = cur_stream->ic->duration/1000000LL;
2344
                thh = tns/3600;
2345
                tmm = (tns%3600)/60;
2346
                tss = (tns%60);
2347
                frac = (double)event.button.x/(double)cur_stream->width;
2348
                ns = frac*tns;
2349
                hh = ns/3600;
2350
                mm = (ns%3600)/60;
2351
                ss = (ns%60);
2352
                fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d)       \n", frac*100,
2353
                        hh, mm, ss, thh, tmm, tss);
2354
                ts = frac*cur_stream->ic->duration;
2355
                if (cur_stream->ic->start_time != AV_NOPTS_VALUE)
2356
                    ts += cur_stream->ic->start_time;
2357
                stream_seek(cur_stream, ts, 0, 0);
2340
                    int64_t ts;
2341
                    int ns, hh, mm, ss;
2342
                    int tns, thh, tmm, tss;
2343
                    tns = cur_stream->ic->duration/1000000LL;
2344
                    thh = tns/3600;
2345
                    tmm = (tns%3600)/60;
2346
                    tss = (tns%60);
2347
                    frac = (double)event.button.x/(double)cur_stream->width;
2348
                    ns = frac*tns;
2349
                    hh = ns/3600;
2350
                    mm = (ns%3600)/60;
2351
                    ss = (ns%60);
2352
                    fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d)       \n", frac*100,
2353
                            hh, mm, ss, thh, tmm, tss);
2354
                    ts = frac*cur_stream->ic->duration;
2355
                    if (cur_stream->ic->start_time != AV_NOPTS_VALUE)
2356
                        ts += cur_stream->ic->start_time;
2357
                    stream_seek(cur_stream, ts, 0, 0);
2358 2358
                }
2359 2359
            }
2360 2360
            break;

Also available in: Unified diff