Change test from visibility to caption mode.

When adding the first character to a buffer, set start time based on the
current caption mode instead of the buffer's visibility.

As requested by Carlos.
Merge with cvs.sourceforge.net
Only ignore first duplicate cmd; Handle PAC row 9, 10 chan 2 & 4 cmds.
Merge cvs.sourceforge.net with output format, spupng.
Clean up debug print to match cvs.sourceforge.net
Fix valgrind complaint.