Skip to content

Commit 57cc14f

Browse files
committed
Instead of asserting, signal a runtime error if the session doesn't contain
any playable tracks at all. Change-Id: Ibbbe2fdcd53b7e020da80c84c8229856107a87e6
1 parent 2375d16 commit 57cc14f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

media/libstagefright/rtsp/MyHandler.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,17 @@ struct MyHandler : public AHandler {
463463
mBaseURL = tmp;
464464
}
465465

466-
CHECK_GT(mSessionDesc->countTracks(), 1u);
467-
setupTrack(1);
466+
if (mSessionDesc->countTracks() < 2) {
467+
// There's no actual tracks in this session.
468+
// The first "track" is merely session meta
469+
// data.
470+
471+
LOGW("Session doesn't contain any playable "
472+
"tracks. Aborting.");
473+
result = ERROR_UNSUPPORTED;
474+
} else {
475+
setupTrack(1);
476+
}
468477
}
469478
}
470479
}
@@ -783,9 +792,13 @@ struct MyHandler : public AHandler {
783792
}
784793

785794
if (mNumAccessUnitsReceived == 0) {
795+
#if 0
786796
LOGI("stream ended? aborting.");
787797
(new AMessage('abor', id()))->post();
788798
break;
799+
#else
800+
LOGI("haven't seen an AU in a looong time.");
801+
#endif
789802
}
790803

791804
mNumAccessUnitsReceived = 0;

0 commit comments

Comments
 (0)