MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / HandleEvents

Function HandleEvents

test/test.c:879–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879static int HandleEvents(hb_handle_t * h, hb_dict_t *preset_dict)
880{
881 hb_state_t s;
882
883 hb_get_state( h, &s );
884 switch( s.state )
885 {
886 case HB_STATE_IDLE:
887 /* Nothing to do */
888 break;
889
890#define p s.param.scanning
891 case HB_STATE_SCANNING:
892 /* Show what title is currently being scanned */
893 if (json)
894 {
895 show_progress_json(&s);
896 break;
897 }
898 if (p.preview_cur)
899 {
900 fprintf(stderr, "%sScanning title %d of %d, preview %d, %.2f %%",
901 stderr_sep, p.title_cur, p.title_count, p.preview_cur, 100 * p.progress);
902 }
903 else
904 {
905 fprintf(stderr, "%sScanning title %d of %d, %.2f %%",
906 stderr_sep, p.title_cur, p.title_count, 100 * p.progress);
907 }
908 fflush(stderr);
909 break;
910#undef p
911
912 case HB_STATE_SCANDONE:
913 {
914 hb_title_set_t * title_set;
915 hb_title_t * title;
916
917 if (job_running)
918 {
919 // SCANDONE generated by a scan during execution of the job
920 break;
921 }
922 title_set = hb_get_title_set( h );
923 if( !title_set || !hb_list_count( title_set->list_title ) )
924 {
925 /* No valid title, stop right there */
926 fprintf( stderr, "No title found.\n" );
927 done_error = HB_ERROR_WRONG_INPUT;
928 die = 1;
929 break;
930 }
931 if (main_feature)
932 {
933 int i;
934 int main_feature_idx=0;
935 int main_feature_pos=-1;
936 int main_feature_time=0;

Callers 1

EventLoopFunction · 0.85

Calls 14

hb_get_stateFunction · 0.85
show_progress_jsonFunction · 0.85
hb_get_title_setFunction · 0.85
hb_list_countFunction · 0.85
hb_list_itemFunction · 0.85
PrintTitleSetInfoFunction · 0.85
hb_value_get_stringFunction · 0.85
hb_dict_getFunction · 0.85
PrintTitleInfoFunction · 0.85
PrepareJobFunction · 0.85
hb_value_get_jsonFunction · 0.85
hb_value_freeFunction · 0.85

Tested by

no test coverage detected