ttml: Replace assertions

Remove assertions and replace, where necessary, with code that handles
the error cases.

https://bugzilla.gnome.org/show_bug.cgi?id=776436
2 files changed