Skip to content

Commit 8eaaa79

Browse files
committed
Rewrite "gettimecode" without using the stupid Decklink strings
1 parent 66e6f29 commit 8eaaa79

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

deckcontrol.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <inttypes.h>
12
#include <stdlib.h>
23
#include <stdio.h>
34
#include <string.h>
@@ -264,9 +265,13 @@ int main(int argc, char *argv[])
264265
deckControl->Shuttle(atof(argv[2]), &deckError);
265266
break;
266267
case GET_TIMECODE:
267-
const char *tcs;
268-
deckControl->GetTimecodeString(&tcs, &deckError);
269-
printf("TC=%s\n", tcs);
268+
IDeckLinkTimecode *currentTimecode;
269+
uint8_t hours, minutes, seconds, frames;
270+
deckControl->GetTimecode(&currentTimecode, &deckError);
271+
currentTimecode->GetComponents(&hours, &minutes, &seconds, &frames);
272+
printf("TC=%02"PRIu8":%02"PRIu8":%02"PRIu8":%02"PRIu8"\n",
273+
hours, minutes, seconds, frames);
274+
SAFE_RELEASE(currentTimecode);
270275
break;
271276
case CRASH_RECORD_START:
272277
deckControl->CrashRecordStart(&deckError);

0 commit comments

Comments
 (0)