Instead of asserting, signal a runtime error if the session doesn't contain

any playable tracks at all.

Change-Id: Ibbbe2fdcd53b7e020da80c84c8229856107a87e6
This commit is contained in:
Andreas Huber
2011-11-10 12:40:30 -08:00
parent 2375d16378
commit 57cc14fcc1

View File

@@ -463,8 +463,17 @@ struct MyHandler : public AHandler {
mBaseURL = tmp;
}
CHECK_GT(mSessionDesc->countTracks(), 1u);
setupTrack(1);
if (mSessionDesc->countTracks() < 2) {
// 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 0
LOGI("stream ended? aborting.");
(new AMessage('abor', id()))->post();
break;
#else
LOGI("haven't seen an AU in a looong time.");
#endif
}
mNumAccessUnitsReceived = 0;