summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2010-07-18 23:33:46 +0200
committerReinhard Nißl <rnissl@gmx.de>2010-07-18 23:33:46 +0200
commit9d5da6a3aae928d7fd702d03ea8212f2db48dd5b (patch)
tree115b488ab4df54b72e0e9345abfa80e32fa500d5
parent9a1825f0c38bab7e3831da512db11e96ff2214d2 (diff)
downloadxine-lib-9d5da6a3aae928d7fd702d03ea8212f2db48dd5b.tar.gz
xine-lib-9d5da6a3aae928d7fd702d03ea8212f2db48dd5b.tar.bz2
Fix input_vdr to use the best match when choosing zoom factors
The current implementation chooses 4:3 when aspect is within +/- 0.0075 % of 4:3. Otherwise 16:9 is chosen. But there are some H.264 channels with almost 4:3 aspect and choosing 16:9 for them is worse. So the new implementation chooses the best match.
-rw-r--r--src/vdr/input_vdr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c
index 999f2e406..ac9a313bd 100644
--- a/src/vdr/input_vdr.c
+++ b/src/vdr/input_vdr.c
@@ -339,13 +339,16 @@ static void adjust_zoom(vdr_input_plugin_t *this)
&& this->image16_9_zoom_x && this->image16_9_zoom_y)
{
int ratio = (int)(10000 * this->frame_size.r + 0.5);
+ int matches4_3 = abs(ratio - 13333);
+ int matches16_9 = abs(ratio - 17778);
+
/* fprintf(stderr, "ratio: %d\n", ratio); */
- if (13332 <= ratio && ratio <= 13334)
+ if (matches4_3 < matches16_9)
{
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, this->image4_3_zoom_x);
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_Y, this->image4_3_zoom_y);
}
- else /* if (17777 <= ratio && ratio <= 17779) */
+ else
{
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, this->image16_9_zoom_x);
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_Y, this->image16_9_zoom_y);