+ else if (isaudio)
+ {
+ audio.pid = (*es)->getPid();
+
+ /* if we find the cached pids, this will be our default stream */
+ if (audio.pid == cached_apid_ac3 || audio.pid == cached_apid_mpeg)
+ program.defaultAudioStream = program.audioStreams.size();
+
+ /* also, we need to know the first non-mpeg (i.e. "ac3"/dts/...) stream */
+ if ((audio.type != audioStream::atMPEG) && ((first_ac3 == -1) || (audio.pid == cached_apid_ac3)))
+ first_ac3 = program.audioStreams.size();
+
+ program.audioStreams.push_back(audio);
+ prev_audio = &program.audioStreams.back();
+ }