* Starts the conversion process. * Sets state to HB_STATE_WORKING. * calls hb_work_init, to launch work thread. Stores handle to work thread. * @param h Handle to hb_handle_t. */
| 1990 | * @param h Handle to hb_handle_t. |
| 1991 | */ |
| 1992 | void hb_start( hb_handle_t * h ) |
| 1993 | { |
| 1994 | hb_lock( h->state_lock ); |
| 1995 | h->state.state = HB_STATE_WORKING; |
| 1996 | h->state.sequence_id = 0; |
| 1997 | #define p h->state.param.working |
| 1998 | p.pass = -1; |
| 1999 | p.pass_count = -1; |
| 2000 | p.progress = 0.0; |
| 2001 | p.rate_cur = 0.0; |
| 2002 | p.rate_avg = 0.0; |
| 2003 | p.eta_seconds = 0; |
| 2004 | p.hours = -1; |
| 2005 | p.minutes = -1; |
| 2006 | p.seconds = -1; |
| 2007 | p.paused = 0; |
| 2008 | #undef p |
| 2009 | hb_unlock( h->state_lock ); |
| 2010 | |
| 2011 | h->paused = 0; |
| 2012 | h->pause_date = -1; |
| 2013 | h->pause_duration = 0; |
| 2014 | h->work_die = 0; |
| 2015 | h->work_error = HB_ERROR_NONE; |
| 2016 | h->work_thread = hb_work_init( h->jobs, &h->work_die, &h->work_error, &h->current_job ); |
| 2017 | } |
| 2018 | |
| 2019 | /** |
| 2020 | * Pauses the conversion process. |