X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fdv1394app.c;h=b1919aec95910e5d3d95994b3df0fbfddf2d3f95;hb=0984db69a0f1bf22495be70aa06b96217d5fb0b8;hp=d367235c7ea4f88f3f08a499d2c87b7746fb36dd;hpb=8abeb6c8e20cb942513fa422d772550615610ee8;p=rugen diff --git a/src/dv1394app.c b/src/dv1394app.c index d367235..b1919ae 100644 --- a/src/dv1394app.c +++ b/src/dv1394app.c @@ -555,3 +555,25 @@ void dv1394app_close( dv1394app this ) page_close( this->pages[ -- this->page_count ] ); free( this ); } + +char* frames2tc( int f, float fps, char* buf ) +{ + int tc[4] = { 0, 0, 0, 0 }; + float d; + int t; + + if ( fps ) + { + d = f / fps; + t = d; + + tc[0] = (d - t) * fps; + tc[1] = t % 60; t /= 60; + tc[2] = t % 60; t /= 60; + tc[3] = t % 24; + } + + sprintf(buf, "%.2d:%.2d:%.2d:%.2d", tc[3], tc[2], tc[1], tc[0]); + + return buf; +}