From 06fa1b73e581558ee1b21d0e313db8c2560d422e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 13 Nov 2012 02:25:59 +0000 Subject: [PATCH] parse keyboard entered drop-frame timecode delta git-svn-id: svn://localhost/ardour2/branches/3.0@13476 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_clock.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index ca1c525a6b..505c06cafa 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -1897,9 +1897,10 @@ bool AudioClock::timecode_validate_edit (const string&) { Timecode::Time TC; + char ignored[2]; - if (sscanf (_layout->get_text().c_str(), "%" PRId32 ":%" PRId32 ":%" PRId32 ":%" PRId32, - &TC.hours, &TC.minutes, &TC.seconds, &TC.frames) != 4) { + if (sscanf (_layout->get_text().c_str(), "%" PRId32 ":%" PRId32 ":%" PRId32 "%[:;]%" PRId32, + &TC.hours, &TC.minutes, &TC.seconds, &ignored, &TC.frames) != 5) { return false; } @@ -1945,8 +1946,9 @@ AudioClock::frames_from_timecode_string (const string& str) const Timecode::Time TC; framepos_t sample; + char ignored[2]; - if (sscanf (str.c_str(), "%d:%d:%d:%d", &TC.hours, &TC.minutes, &TC.seconds, &TC.frames) != 4) { + if (sscanf (str.c_str(), "%d:%d:%d%[:;]%d", &TC.hours, &TC.minutes, &TC.seconds, &ignored, &TC.frames) != 4) { error << string_compose (_("programming error: %1 %2"), "badly formatted timecode clock string", str) << endmsg; return 0; }