hotfix negative TC editing - problem was introduced in r13491

git-svn-id: svn://localhost/ardour2/branches/3.0@13506 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus 2012-11-15 13:19:07 +00:00
parent 60f85cac42
commit a6968f8d2c

View file

@ -1925,8 +1925,8 @@ AudioClock::timecode_validate_edit (const string&)
int hours;
char ignored[2];
if (sscanf (_layout->get_text().c_str(), "%" PRId32 ":%" PRId32 ":%" PRId32 "%[:;]%" PRId32,
&hours, &TC.minutes, &TC.seconds, ignored, &TC.frames) != 5) {
if (sscanf (_layout->get_text().c_str(), "%[- _]%" PRId32 ":%" PRId32 ":%" PRId32 "%[:;]%" PRId32,
ignored, &hours, &TC.minutes, &TC.seconds, ignored, &TC.frames) != 6) {
return false;
}
@ -1987,7 +1987,7 @@ AudioClock::frames_from_timecode_string (const string& str) const
char ignored[2];
int hours;
if (sscanf (str.c_str(), "%d:%d:%d%[:;]%d", &hours, &TC.minutes, &TC.seconds, ignored, &TC.frames) != 5) {
if (sscanf (str.c_str(), "%[- _]%d:%d:%d%[:;]%d", ignored, &hours, &TC.minutes, &TC.seconds, ignored, &TC.frames) != 6) {
error << string_compose (_("programming error: %1 %2"), "badly formatted timecode clock string", str) << endmsg;
return 0;
}