Changeset 2485:1cbb82cde915 in roaraudio


Ignore:
Timestamp:
08/23/09 21:31:33 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

make sources optional

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/roard.c

    r2451 r2485  
    8686 printf(" -oP                   - Mark output as primary\n"); 
    8787 
     88#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    8889 printf("\nSource Options:\n\n"); 
    8990 printf(" -s  --source DRV      - Use DRV as input driver\n" 
     
    9495       ); 
    9596 printf(" --list-sources        - List all sources\n"); 
     97#endif 
    9698 
    9799 printf("\nCodec Filter Options:\n\n"); 
     
    732734 } 
    733735 
     736#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    734737 if ( sources_init() == -1 ) { 
    735738  ROAR_ERR("Can not init sources!"); 
     
    741744  return 1; 
    742745 } 
     746#endif 
    743747 
    744748#ifdef ROAR_HAVE_MAIN_ARGS 
     
    873877 
    874878  } else if ( strcmp(k, "-s") == 0 || strcmp(k, "--source") == 0 ) { 
     879#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    875880   s_drv = argv[++i]; 
     881#else 
     882   ROAR_ERR("main(*): No support for sources compiled in"); 
     883#endif 
    876884  } else if ( strcmp(k, "-S") == 0 ) { 
     885#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    877886   s_dev = argv[++i]; 
     887#else 
     888   ROAR_ERR("main(*): No support for sources compiled in"); 
     889#endif 
    878890  } else if ( strcmp(k, "-sO") == 0 ) { 
     891#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    879892   s_opt = argv[++i]; 
     893#else 
     894   ROAR_ERR("main(*): No support for sources compiled in"); 
     895#endif 
    880896  } else if ( strcmp(k, "-sC") == 0 ) { 
     897#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    881898   s_con = argv[++i]; 
     899#else 
     900   ROAR_ERR("main(*): No support for sources compiled in"); 
     901#endif 
    882902  } else if ( strcmp(k, "-sP") == 0 ) { 
     903#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    883904   s_prim = 1; 
     905#else 
     906   ROAR_ERR("main(*): No support for sources compiled in"); 
     907#endif 
    884908  } else if ( strcmp(k, "-sN") == 0 ) { 
     909#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    885910   if ( sources_add(s_drv, s_dev, s_con, s_opt, s_prim) == -1 ) { 
    886911    ROAR_ERR("main(*): adding source '%s' via '%s' failed!", s_dev, s_drv); 
     
    889914   s_drv = "cf"; 
    890915   s_prim = 0; 
     916#else 
     917   ROAR_ERR("main(*): No support for sources compiled in"); 
     918#endif 
    891919  } else if ( strcmp(k, "--list-sources") == 0 ) { 
     920#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    892921   print_sourcelist(); 
    893922   return 0; 
     923#else 
     924   ROAR_ERR("main(*): No support for sources compiled in"); 
     925#endif 
    894926 
    895927  } else if ( strcmp(k, "--light-channels") == 0 ) { 
     
    10271059#endif 
    10281060 
     1061#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    10291062 if ( s_dev != NULL ) { 
    10301063  if ( sources_add(s_drv, s_dev, s_con, s_opt, s_prim) == -1 ) { 
     
    10321065  } 
    10331066 } 
     1067#endif 
    10341068 
    10351069 add_output(o_drv, o_dev, o_opts, o_prim, o_count); 
     
    12951329 cleanup_listen_socket(0); 
    12961330 
     1331#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
    12971332 sources_free(); 
     1333#endif 
    12981334 streams_free(); 
    12991335 clients_free(); 
  • roard/sources.c

    r2290 r2485  
    2525#include "roard.h" 
    2626 
     27#ifndef ROAR_WITHOUT_DCOMP_SOURCES 
     28 
    2729struct roar_source g_source[] = { 
    2830 {"raw",  "Raw source",                  "/some/file",     SRC_FLAG_FHSEC, ROAR_SUBSYS_WAVEFORM, NULL,  sources_add_raw}, 
     
    440442} 
    441443 
     444#endif 
     445 
    442446//ll 
Note: See TracChangeset for help on using the changeset viewer.