summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);