|
From: Richard B. <ba...@th...> - 2004-12-08 15:52:16
|
Attached is a patch that adds the function "dv_encode_timecode_fps()" to headers.c and the public api of libdv. The function acts exactly like dv_encode_timecode(), but takes an additional parameter (the frame rate). This allows drop frame/non-drop frame timecodes to be encoded, as well as non-pal or ntsc frame rates such as film. dv_encode_timecode() is maintained so as not to break the api, and serves as a wrapper to dv_encode_timecode_fps() (with the same behavior as before - 30 fps assumed for NTSC). write_timecode_13() is modified to take a double parameter instead of an integer to determine the frame rate. In write_subcode_blocks(), 30 fps is again assumed to be the frame rate for ntsc when write_timecode_13() is called. While this fixes the dv_encode_timecode() issue for non-drop frame timecode, you can see there are some wrong assumptions still in the rest of libdv. I didn't want to delve any further into the library until I got some feedback. In some cases, it will be necessary to change the internal api (write_subcode_blocks() for example will have to take an fps parameter), and the public api (an fps field in dv_encoder_t). Anyways, with this patch, everything works as before unless you use dv_encode_timecode_fps(). Richard |