diff options
author | Bradley Sepos <[email protected]> | 2015-08-29 18:55:32 -0400 |
---|---|---|
committer | Bradley Sepos <[email protected]> | 2015-09-10 15:33:06 -0400 |
commit | 400bb38bf8ebc7dbe1c8eb5f525983ebdfd5d3b0 (patch) | |
tree | 59c3e86962ff23c5d42efaca242257cf9b2ef487 /libhb/common.c | |
parent | cbb6fbdbdf2fec70a4d06bf8742c95dfb060f2ed (diff) |
libhb: Clock/frame rate handling improvements.
Allows for arbitrary frame rates between 1 and 1000 fps.
Adds min/max frame rates to CLI help.
Removes hardcoded instances of the internal clock rate in favor of hb_video_framerate_get_limits().
Unfortunately, much of the codebase generally refers to clock rate as frame rate, so a little extra care is still necessary going forward.
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c index b63b1cfff..092d6d306 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -96,6 +96,9 @@ hb_rate_internal_t hb_video_rates[] = { { "60", 450000, }, NULL, 1, }, }; int hb_video_rates_count = sizeof(hb_video_rates) / sizeof(hb_video_rates[0]); +const int hb_video_rate_clock = 27000000; // 27MHz clock +int hb_video_rate_min = hb_video_rate_clock / 1000; // Min clock rate from *max* frame rate +int hb_video_rate_max = hb_video_rate_clock / 1; // Max clock rate from *min* frame rate hb_rate_t *hb_audio_rates_first_item = NULL; hb_rate_t *hb_audio_rates_last_item = NULL; @@ -670,6 +673,13 @@ const char* hb_video_framerate_sanitize_name(const char *name) return hb_video_framerate_get_name(hb_video_framerate_get_from_name(name)); } +void hb_video_framerate_get_limits(int *low, int *high, int *clock) +{ + *low = hb_video_rate_min; + *high = hb_video_rate_max; + *clock = hb_video_rate_clock; +} + const hb_rate_t* hb_video_framerate_get_next(const hb_rate_t *last) { if (last == NULL) |