using boost::shared_ptr;
using boost::weak_ptr;
using boost::optional;
+using namespace dcpomatic;
ClosedCaptionsDialog::ClosedCaptionsDialog (wxWindow* parent, FilmViewer* viewer)
: wxDialog (parent, wxID_ANY, _("Closed captions"), wxDefaultPosition, wxDefaultSize,
_current = optional<TextRingBuffers::Data>();
}
- if (!_current) {
+ if (!_current && !_tracks.empty()) {
/* We have no current one: get another */
shared_ptr<Butler> butler = _butler.lock ();
DCPOMATIC_ASSERT (butler);
+ DCPOMATIC_ASSERT (_track->GetSelection() >= 0);
DCPOMATIC_ASSERT (_track->GetSelection() < int(_tracks.size()));
DCPTextTrack track = _tracks[_track->GetSelection()];
while (true) {