Changeset 3323:043a35dd07e5 in roaraudio


Ignore:
Timestamp:
02/03/10 23:26:06 (10 years ago)
Author:
phi
Branch:
default
Message:

support ROAR_VIO_CTL_SET_AUINFO

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_rtp.c

    r3289 r3323  
    331331int     roar_vio_rtp_ctl     (struct roar_vio_calls * vio, int cmd, void * data) { 
    332332 struct roar_rtp_inst * self = vio->inst; 
    333  struct roar_stream          * s  = NULL; 
    334  struct roar_stream_server   * ss = NULL; 
     333 struct roar_stream          * s    = NULL; 
     334 struct roar_stream_server   * ss   = NULL; 
     335 struct roar_audio_info      * info = NULL; 
    335336 
    336337 ROAR_DBG("roar_vio_rtp_ctl(vio=%p, cmd=%i, data=%p) = ?", vio, cmd, data); 
     
    344345  case ROAR_VIO_CTL_SET_SSTREAM: 
    345346    s = ROAR_STREAM(ss = data); 
     347    info = &(s->info); 
    346348   break; 
    347349  case ROAR_VIO_CTL_SET_STREAM: 
    348350    s = ROAR_STREAM(data); 
     351    info = &(s->info); 
     352   break; 
     353  case ROAR_VIO_CTL_SET_AUINFO: 
     354    info = data; 
    349355   break; 
    350356  case ROAR_VIO_CTL_GET_NEXT: 
     
    360366 ROAR_DBG("roar_vio_rtp_ctl(vio=%p, cmd=%i, data=%p) = ?", vio, cmd, data); 
    361367 
    362  if ( s != NULL ) { 
    363   switch (s->info.codec) { 
     368 if ( info != NULL ) { 
     369  switch (info->codec) { 
    364370   case ROAR_CODEC_PCM_S_LE: 
    365371   case ROAR_CODEC_PCM_S_PDP: 
    366      s->info.codec = ROAR_CODEC_PCM_S_BE; 
     372     info->codec = ROAR_CODEC_PCM_S_BE; 
    367373    break; 
    368374   case ROAR_CODEC_PCM_U_LE: 
    369375   case ROAR_CODEC_PCM_U_PDP: 
    370      s->info.codec = ROAR_CODEC_PCM_U_BE; 
     376     info->codec = ROAR_CODEC_PCM_U_BE; 
    371377    break; 
    372378  } 
    373379 
    374   memcpy(&(self->info), &(s->info), sizeof(struct roar_audio_info)); 
    375  
    376   self->header.payload_type = _info2pt(&(s->info)); 
    377  
    378   self->bpf                 = s->info.channels * s->info.bits / 8; 
     380  memcpy(&(self->info), info, sizeof(struct roar_audio_info)); 
     381 
     382  self->header.payload_type = _info2pt(info); 
     383 
     384  self->bpf                 = info->channels * info->bits / 8; 
    379385 
    380386  roar_vio_ctl(self->vio, cmd, data); 
Note: See TracChangeset for help on using the changeset viewer.