Keeps track of how much time is spent paused and factors that into
the ETA calculation
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2918
b64f7644-9d1e-0410-96f1-
a4d463321fa5
volatile int * die;
volatile int done;
+ uint64_t st_pause_date;
+ uint64_t st_paused;
+
hb_fifo_t * fifo_mpeg2; /* MPEG-2 video ES */
hb_fifo_t * fifo_raw; /* Raw pictures */
hb_fifo_t * fifo_sync; /* Raw pictures, framerate corrected */
hb_lock( h->pause_lock );
h->paused = 1;
+ hb_current_job( h )->st_pause_date = hb_get_date();
+
hb_lock( h->state_lock );
h->state.state = HB_STATE_PAUSED;
hb_unlock( h->state_lock );
{
if( h->paused )
{
+#define job hb_current_job( h )
+ if( job->st_pause_date != -1 )
+ {
+ job->st_paused += hb_get_date() - job->st_pause_date;
+ }
+#undef job
+
hb_unlock( h->pause_lock );
h->paused = 0;
}
if( !pv->count_frames )
{
pv->st_first = hb_get_date();
+ pv->job->st_pause_date = -1;
+ pv->job->st_paused = 0;
}
pv->count_frames++;
{
int eta;
p.rate_avg = 1000.0 * (float) pv->st_counts[3] /
- (float) ( pv->st_dates[3] - pv->st_first );
+ (float) ( pv->st_dates[3] - pv->st_first - pv->job->st_paused);
eta = (float) ( pv->count_frames_max - pv->st_counts[3] ) /
p.rate_avg;
p.hours = eta / 3600;