Merge "Instead of asserting, signal a runtime error if the session doesn't contain" into ics-mr1

This commit is contained in:
Andreas Huber
2011-11-11 07:39:25 -08:00
committed by Android (Google) Code Review

View File

@@ -463,8 +463,17 @@ struct MyHandler : public AHandler {
mBaseURL = tmp; mBaseURL = tmp;
} }
CHECK_GT(mSessionDesc->countTracks(), 1u); if (mSessionDesc->countTracks() < 2) {
setupTrack(1); // There's no actual tracks in this session.
// The first "track" is merely session meta
// data.
LOGW("Session doesn't contain any playable "
"tracks. Aborting.");
result = ERROR_UNSUPPORTED;
} else {
setupTrack(1);
}
} }
} }
} }
@@ -783,9 +792,13 @@ struct MyHandler : public AHandler {
} }
if (mNumAccessUnitsReceived == 0) { if (mNumAccessUnitsReceived == 0) {
#if 0
LOGI("stream ended? aborting."); LOGI("stream ended? aborting.");
(new AMessage('abor', id()))->post(); (new AMessage('abor', id()))->post();
break; break;
#else
LOGI("haven't seen an AU in a looong time.");
#endif
} }
mNumAccessUnitsReceived = 0; mNumAccessUnitsReceived = 0;