Changeset 5386:a3dc37deacbb in roaraudio


Ignore:
Timestamp:
01/14/12 19:17:33 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

only try to display mixer data as well as channel map if number of channels is in range for those functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r5384 r5386  
    401401                                     s.info.codec == ROAR_CODEC_DEFAULT ? " native" : ""); 
    402402// printf("Server Output rate: %i", s.info.rate); 
    403   if ( g_verbose > 1 && s.pos != (uint32_t)-1 ) 
    404    printf("Server Position       : %lu S (%.3fs)\n", (unsigned long int) s.pos, (float)s.pos/(s.info.rate*s.info.channels)); 
     403  if ( g_verbose > 1 && s.pos != (uint32_t)-1 ) { 
     404   if ( s.info.rate && s.info.channels ) { 
     405    printf("Server Position       : %lu S (%.3fs)\n", (unsigned long int) s.pos, (float)s.pos/(s.info.rate*s.info.channels)); 
     406   } else { 
     407    printf("Server Position       : %lu S\n", (unsigned long int) s.pos); 
     408   } 
     409  } 
    405410} 
    406411 
     
    734739 } 
    735740 
    736  if ( g_verbose ) { 
     741 if ( g_verbose && (s.info.channels != 0 && s.info.channels <= ROAR_MAX_CHANNELS) ) { 
    737742  len = ROAR_MAX_CHANNELS; 
    738743  if ( roar_stream_get_chanmap(con, &s, chanmap, &len) == -1 ) { 
     
    748753 
    749754 if ( s.dir != ROAR_DIR_THRU ) { 
    750   display_mixer(con, id); 
     755  if ( s.info.channels != 0 && s.info.channels <= ROAR_MAX_CHANNELS ) { 
     756   display_mixer(con, id); 
     757  } 
    751758  show_meta_all(con, id); 
    752759 } 
Note: See TracChangeset for help on using the changeset viewer.