X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=libhb%2Fmuxcommon.c;h=b6b5a2a579145bbd4cd525e12a34a32c46795b4c;hb=32219d93ec8fcf0db6f7ca5d6045419882563951;hp=702285bba39d6d23fe85bf42a0f3ba4941e2da06;hpb=e0a87cfd2007bb0c862029f19d4340d7c97e37c2;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c index 702285bb..b6b5a2a5 100644 --- a/libhb/muxcommon.c +++ b/libhb/muxcommon.c @@ -289,6 +289,19 @@ void muxClose( hb_work_object_t * w ) hb_lock( mux->mutex ); if ( --mux->ref == 0 ) { + // Update state before closing muxer. Closing the muxer + // may initiate optimization which can take a while and + // we want the muxing state to be visible while this is + // happening. + if( job->pass == 0 || job->pass == 2 ) + { + /* Update the UI */ + hb_state_t state; + state.state = HB_STATE_MUXING; + state.param.muxing.progress = 0; + hb_set_state( job->h, &state ); + } + if( mux->m ) { mux->m->end( mux->m ); @@ -301,12 +314,6 @@ void muxClose( hb_work_object_t * w ) struct stat sb; uint64_t bytes_total, frames_total; - /* Update the UI */ - hb_state_t state; - state.state = HB_STATE_MUXING; - state.param.muxing.progress = 0; - hb_set_state( job->h, &state ); - if( !stat( job->file, &sb ) ) { hb_deep_log( 2, "mux: file size, %"PRId64" bytes", (uint64_t) sb.st_size );