summaryrefslogtreecommitdiff
path: root/xine_input_vdr.c
diff options
context:
space:
mode:
authorphintuka <phintuka>2008-06-21 22:26:38 +0000
committerphintuka <phintuka>2008-06-21 22:26:38 +0000
commitce13aec0aebd6730a6c3c462580ca796a376fd07 (patch)
tree28be46e4bdf4ece9deaa329cc1b6d5a824467556 /xine_input_vdr.c
parentceb417b557f503d07264fe11765f6b0798bfdf6a (diff)
downloadxineliboutput-ce13aec0aebd6730a6c3c462580ca796a376fd07.tar.gz
xineliboutput-ce13aec0aebd6730a6c3c462580ca796a376fd07.tar.bz2
Convert pixel ratio to frame ratio in post_frame_end()
Diffstat (limited to 'xine_input_vdr.c')
-rw-r--r--xine_input_vdr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index fc7a731f..c5794acf 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.156 2008-06-21 22:23:17 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.157 2008-06-21 22:26:38 phintuka Exp $
*
*/
@@ -4931,9 +4931,17 @@ static void post_frame_end(vdr_input_plugin_t *this, buf_element_t *vid_buf)
bmi->biWidth = size.width;
bmi->biHeight = size.height;
- cbuf->decoder_flags |= BUF_FLAG_ASPECT;
- cbuf->decoder_info[1] = size.pixel_aspect.num;
- cbuf->decoder_info[2] = size.pixel_aspect.den;
+ if (size.pixel_aspect.num) {
+ cbuf->decoder_flags |= BUF_FLAG_ASPECT;
+ /* pixel ratio -> frame ratio */
+ if(size.pixel_aspect.num > size.height) {
+ cbuf->decoder_info[1] = size.pixel_aspect.num / size.height;
+ cbuf->decoder_info[2] = size.pixel_aspect.den / size.width;
+ } else {
+ cbuf->decoder_info[1] = size.pixel_aspect.num * size.width;
+ cbuf->decoder_info[2] = size.pixel_aspect.den * size.height;
+ }
+ }
LOGDBG("post_frame_end: video width %d, height %d, pixel aspect %d:%d",
size.width, size.height, size.pixel_aspect.num, size.pixel_aspect.den);