From 0b63d2cd38ea6bd93bd0bfcd5bf97e50e3b7532f Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Wed, 30 May 2018 18:36:02 +0200 Subject: [PATCH] port from https://github.com/tuxbox-neutrino/library-stb-hal/commits/mpx - https://github.com/tuxbox-neutrino/library-stb-hal/commit/7e4f4fd907e08702df853e2d5b4d5c671fe4b659 - https://github.com/tuxbox-neutrino/library-stb-hal/commit/dc7076847f1cc8359536a534dcf7aa2fa813b798 - https://github.com/tuxbox-neutrino/library-stb-hal/commit/8292a45148e2d22dd5861261ee1d3a40c59494bc Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/1e26cd81b38df923bf6b2b32ffe1b9fbab713890 Author: Frankenstone Date: 2018-05-30 (Wed, 30 May 2018) ------------------ This commit was generated by Migit --- libspark/video.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libspark/video.cpp b/libspark/video.cpp index a190ac8..8510ca5 100644 --- a/libspark/video.cpp +++ b/libspark/video.cpp @@ -392,7 +392,7 @@ int cVideo::getAspectRatio(void) { /* in movieplayer mode, fd is not opened -> fall back to procfs */ int n = proc_get_hex(VMPEG_aspect[devnum]); - return n * 2 + 1; + return n; } if (fop(ioctl, VIDEO_GET_SIZE, &s) < 0) { @@ -800,7 +800,7 @@ static inline int rate2csapi(int rate) return 4; case 50000: return 5; - case 50940: + case 59940: return 6; case 60000: return 7; @@ -817,7 +817,10 @@ void cVideo::getPictureInfo(int &width, int &height, int &rate) if (fd == -1) { /* in movieplayer mode, fd is not opened -> fall back to procfs */ - r = proc_get_hex(VMPEG_framerate[devnum]); + char buf[16]; + int n = proc_get(VMPEG_framerate[devnum], buf, 16); + if (n > 0) + sscanf(buf, "%i", &r); width = proc_get_hex(VMPEG_xres[devnum]); height = proc_get_hex(VMPEG_yres[devnum]); rate = rate2csapi(r);