private int outputConfigure(int[][] layoutMap,int tags,int ocType,boolean getNewFrame){
  if (ac.oc[1].layoutMap != layoutMap) {
    for (int i=0; i < tags; i++) {
      System.arraycopy(layoutMap[i],0,ac.oc[1].layoutMap[i],0,3);
    }
    ac.oc[1].layoutMapTags=tags;
  }
  int layout=sniffChannelOrder(layoutMap,tags);
  int channels[]=new int[1];
  for (int i=0; i < tags; i++) {
    int type=layoutMap[i][0];
    int id=layoutMap[i][1];
    int position=layoutMap[i][2];
    int ret=cheConfigure(position,type,id,channels);
    if (ret < 0) {
      return ret;
    }
  }
  if (ac.oc[1].m4ac.ps == 1 && channels[0] == 2) {
    if (layout == CH_FRONT_CENTER) {
      layout=CH_FRONT_LEFT | CH_FRONT_RIGHT;
    }
 else {
      layout=0;
    }
  }
  for (int i=0; i < 4; i++) {
    for (int j=0; j < MAX_ELEM_ID; j++) {
      ac.tagCheMap[i][j]=ac.che[i][j];
    }
  }
  ac.oc[1].channelLayout=layout;
  ac.channels=channels[0];
  ac.oc[1].channels=channels[0];
  ac.oc[1].status=ocType;
  if (getNewFrame) {
    int ret=frameConfigureElements();
    if (ret < 0) {
      return ret;
    }
  }
  return 0;
}

private int outputConfigure ( int [ ] [ ] layoutMap , int tags , int ocType , boolean getNewFrame ) { if ( ac . oc [ 1 ] . layoutMap != layoutMap ) { for ( int i = 0 ; i < tags ; i ++ ) { System . arraycopy ( layoutMap [ i ] , 0 , ac . oc [ 1 ] . layoutMap [ i ] , 0 , 3 ) ; } ac . oc [ 1 ] . layoutMapTags = tags ; } int layout = sniffChannelOrder ( layoutMap , tags ) ; int channels [ ] = new int [ 1 ] ; for ( int i = 0 ; i < tags ; i ++ ) { int type = layoutMap [ i ] [ 0 ] ; int id = layoutMap [ i ] [ 1 ] ; int position = layoutMap [ i ] [ 2 ] ; int ret = cheConfigure ( position , type , id , channels ) ; if ( ret < 0 ) { return ret ; } } if ( ac . oc [ 1 ] . m4ac . ps == 1 && channels [ 0 ] == 2 ) { if ( layout == CH_FRONT_CENTER ) { layout = CH_FRONT_LEFT | CH_FRONT_RIGHT ; } else { layout = 0 ; } } for ( int i = 0 ; i < 4 ; i ++ ) { for ( int j = 0 ; j < MAX_ELEM_ID ; j ++ ) { ac . tagCheMap [ i ] [ j ] = ac . che [ i ] [ j ] ; } } ac . oc [ 1 ] . channelLayout = layout ; ac . channels = channels [ 0 ] ; ac . oc [ 1 ] . channels = channels [ 0 ] ; ac . oc [ 1 ] . status = ocType ; if ( getNewFrame ) { int ret = frameConfigureElements ( ) ; if ( ret < 0 ) { return ret ; } } return 0 ; }
configure output channel order based on the current program configuration element .
