diff options
author | Clément Bœsch <clement.boesch@smartjog.com> | 2011-07-06 14:55:06 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2011-08-10 16:00:32 +0200 |
commit | 51fb933dd0dda5f581d7489b32b8446767d33b97 (patch) | |
tree | 158d09eb2a5471973bb13332d2d45a47c793fdf5 /libavcodec/timecode.c | |
parent | 5231454560e972033ec773b350dfe0e1380a04ae (diff) | |
download | ffmpeg-51fb933dd0dda5f581d7489b32b8446767d33b97.tar.gz |
timecode: move dropframe code and doxycomment it.
This is based on the original work by Baptiste Coudurier.
Diffstat (limited to 'libavcodec/timecode.c')
-rw-r--r-- | libavcodec/timecode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/timecode.c b/libavcodec/timecode.c index d9c3f7d8d2..434b3cb03a 100644 --- a/libavcodec/timecode.c +++ b/libavcodec/timecode.c @@ -28,6 +28,15 @@ #include "timecode.h" #include "libavutil/log.h" +int ff_framenum_to_drop_timecode(int frame_num) +{ + /* only works for NTSC 29.97 */ + int d = frame_num / 17982; + int m = frame_num % 17982; + //if (m < 2) m += 2; /* not needed since -2,-1 / 1798 in C returns 0 */ + return frame_num + 18 * d + 2 * ((m - 2) / 1798); +} + int ff_init_smtpe_timecode(void *avcl, struct ff_timecode *tc) { int hh, mm, ss, ff, fps; |