Logo Search packages:      
Sourcecode: vcdimager version File versions

unsigned int vcdinfo_audio_type_num_channels ( const vcdinfo_obj_t *  obj,
unsigned int  audio_type 
)

Return the number of audio channels implied by "audio_type". 0 is returned on error.

Return the number of audio channels implied by "audio_type". 0 is returned on error.

Definition at line 176 of file info.c.

References vcdinfo_audio_type_num_channels().

Referenced by vcdinfo_audio_type_num_channels().

{
  const int audio_types[2][5] =
    {
      { /* VCD 2.0 */
        0,   /* no audio*/
        1,   /* single channel */
        1,   /* stereo */
        2,   /* dual channel */
        0},  /* error */

      { /* SVCD, HQVCD */
        0,   /* no stream */ 
        1,   /*  1 stream */ 
        2,   /*  2 streams */
        1,   /*  1 multi-channel stream (surround sound) */
        0}   /*  error */
    };

  /* We should also check that the second index is in range too. */
  if (audio_type > 4) {
    return 0;
  }
  
  /* Get first index entry into above audio_type array from vcd_type */
  switch (obj->vcd_type) {

  case VCD_TYPE_VCD:
  case VCD_TYPE_VCD11:
    return 1;

  case VCD_TYPE_VCD2:
    return 3;
    break;

  case VCD_TYPE_HQVCD:
  case VCD_TYPE_SVCD:
    return audio_types[1][audio_type];
    break;

  case VCD_TYPE_INVALID:
  default:
    /* We have an invalid entry. Set to handle below. */
    return 0;
  }
}


Generated by  Doxygen 1.6.0   Back to index