Annotation of multiplexer/init.c, revision 1.6

1.1       oskar       1: /*
                      2:  * ISO 13818 stream multiplexer
                      3:  * Copyright (C) 2001 Convergence Integrated Media GmbH Berlin
1.5       oskar       4:  * Author: Oskar Schirmer (oskar@scara.com)
1.6     ! oskar       5:  *
        !             6:  * This program is free software; you can redistribute it and/or modify
        !             7:  * it under the terms of the GNU General Public License as published by
        !             8:  * the Free Software Foundation; either version 2 of the License, or
        !             9:  * (at your option) any later version.
        !            10:  *
        !            11:  * This program is distributed in the hope that it will be useful,
        !            12:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            13:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            14:  * GNU General Public License for more details.
        !            15:  *
        !            16:  * You should have received a copy of the GNU General Public License
        !            17:  * along with this program; if not, write to the Free Software
        !            18:  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1.1       oskar      19:  */
                     20: 
                     21: /*
                     22:  * Module:  Init
                     23:  * Purpose: Initialization and start the dispatcher loop.
                     24:  */
                     25: 
                     26: #include "global.h"
                     27: #include "crc.h"
                     28: #include "error.h"
                     29: #include "input.h"
                     30: #include "output.h"
                     31: #include "splice.h"
                     32: #include "command.h"
                     33: #include "dispatch.h"
                     34: 
1.4       oskar      35: int main (int argc,
1.1       oskar      36:     char *argv[])
                     37: {
                     38:   int a;
                     39:   global_init ();
                     40:   a = msec_now ();
                     41:   gen_crc_table ();
                     42:   if (input_init ()) {
                     43:     if (output_init ()) {
                     44:       if (splice_init ()) {
                     45:         if (dispatch_init ()) {
                     46:           if (command_init (argc,&argv[0])) {
                     47:             dispatch ();
1.3       oskar      48: #ifdef DEBUG_TIMEPOLL
1.1       oskar      49:             warn (LDEB,"Global delta",EINI,0,0,global_delta);
1.3       oskar      50:             warn (LERR,"(msec) Exit Time ",EINI,0,0,
1.1       oskar      51:               msec_now () - a);
1.3       oskar      52:             warn (LERR,"(msec) Exit Clock",EINI,0,0,
1.1       oskar      53:               clock ()/(CLOCKS_PER_SEC/1000));
1.3       oskar      54: #endif
1.1       oskar      55:           }
1.2       oskar      56:           exit (EXIT_SUCCESS);
1.1       oskar      57:         } else {
                     58:           warn (LERR,"Dispatch Fail",EINI,0,6,0);
                     59:         }
                     60:       } else {
                     61:         warn (LERR,"Splice Fail",EINI,0,5,0);
                     62:       }
                     63:     } else {
                     64:       warn (LERR,"Output Fail",EINI,0,4,0);
                     65:     }
                     66:   } else {
                     67:     warn (LERR,"Input Fail",EINI,0,3,0);
                     68:   }
                     69:   exit (EXIT_FAILURE);
                     70: }
                     71: 

LinuxTV legacy CVS <linuxtv.org/cvs>