private void partitionTracks(){
  List<MediaTrack> allTracks=mMediaInfo.getMediaTracks();
  mAudioTracks.clear();
  mTextTracks.clear();
  mTextTracks.add(buildNoneTrack());
  mSelectedTextPosition=0;
  mSelectedAudioPosition=-1;
  if (allTracks != null) {
    int textPosition=1;
    int audioPosition=0;
    for (    MediaTrack track : allTracks) {
switch (track.getType()) {
case MediaTrack.TYPE_TEXT:
        mTextTracks.add(track);
      if (mActiveTracks != null) {
        for (        long mActiveTrack : mActiveTracks) {
          if (mActiveTrack == track.getId()) {
            mSelectedTextPosition=textPosition;
          }
        }
      }
    textPosition++;
  break;
case MediaTrack.TYPE_AUDIO:
mAudioTracks.add(track);
if (mActiveTracks != null) {
for (long mActiveTrack : mActiveTracks) {
  if (mActiveTrack == track.getId()) {
    mSelectedAudioPosition=audioPosition;
  }
}
}
audioPosition++;
break;
}
}
}
}

private void partitionTracks ( ) { List < MediaTrack > allTracks = mMediaInfo . getMediaTracks ( ) ; mAudioTracks . clear ( ) ; mTextTracks . clear ( ) ; mTextTracks . add ( buildNoneTrack ( ) ) ; mSelectedTextPosition = 0 ; mSelectedAudioPosition = - 1 ; if ( allTracks != null ) { int textPosition = 1 ; int audioPosition = 0 ; for ( MediaTrack track : allTracks ) { switch ( track . getType ( ) ) { case MediaTrack . TYPE_TEXT : mTextTracks . add ( track ) ; if ( mActiveTracks != null ) { for ( long mActiveTrack : mActiveTracks ) { if ( mActiveTrack == track . getId ( ) ) { mSelectedTextPosition = textPosition ; } } } textPosition ++ ; break ; case MediaTrack . TYPE_AUDIO : mAudioTracks . add ( track ) ; if ( mActiveTracks != null ) { for ( long mActiveTrack : mActiveTracks ) { if ( mActiveTrack == track . getId ( ) ) { mSelectedAudioPosition = audioPosition ; } } } audioPosition ++ ; break ; } } } }
this method loops through the tracks and partitions them into a group of text tracks and a group of audio tracks , and skips over the video tracks .
