From 2e765e73c2b5f0b7942a1afd0be8f62342397951 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 20 Mar 2017 14:30:16 +0100 Subject: [PATCH 1/2] generic-pc/video.cpp dont set output format with negative height size --- generic-pc/video.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generic-pc/video.cpp b/generic-pc/video.cpp index 6cd7ec4..208cc57 100644 --- a/generic-pc/video.cpp +++ b/generic-pc/video.cpp @@ -82,6 +82,7 @@ cVideo::cVideo(int, void *, void *, unsigned int) display_aspect = DISPLAY_AR_16_9; display_crop = DISPLAY_AR_MODE_LETTERBOX; v_format = VIDEO_FORMAT_MPEG2; + output_h = 0; } cVideo::~cVideo(void) @@ -98,7 +99,7 @@ int cVideo::setAspectRatio(int vformat, int cropping) display_aspect = (DISPLAY_AR) vformat; if (cropping >= 0) display_crop = (DISPLAY_AR_MODE) cropping; - if (display_aspect < DISPLAY_AR_RAW) /* don't know what to do with this */ + if (display_aspect < DISPLAY_AR_RAW && output_h > 0) /* don't know what to do with this */ glfb->setOutputFormat(aspect_ratios[display_aspect], output_h, display_crop); return 0; } @@ -197,7 +198,7 @@ int cVideo::SetVideoSystem(int system, bool) } v_std = (VIDEO_STD) system; output_h = h; - if (display_aspect < DISPLAY_AR_RAW) /* don't know what to do with this */ + if (display_aspect < DISPLAY_AR_RAW && output_h > 0) /* don't know what to do with this */ glfb->setOutputFormat(aspect_ratios[display_aspect], output_h, display_crop); return 0; } From ad24fab431a4f0cc4c8b1ceff119cbf5664bba12 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 18 Jun 2017 13:15:35 +0200 Subject: [PATCH 2/2] fix compile --- generic-pc/video.cpp | 12 ++++++++++++ generic-pc/video_lib.h | 1 + 2 files changed, 13 insertions(+) diff --git a/generic-pc/video.cpp b/generic-pc/video.cpp index 208cc57..bf54a27 100644 --- a/generic-pc/video.cpp +++ b/generic-pc/video.cpp @@ -203,6 +203,18 @@ int cVideo::SetVideoSystem(int system, bool) return 0; } +int cVideo::GetVideoSystem() +{ + int current_video_system = VIDEO_STD_1080I50; + + if(dec_w < 720) + current_video_system = VIDEO_STD_PAL; + else if(dec_w > 720 && dec_w <= 1280) + current_video_system = VIDEO_STD_720P50; + + return 0; +} + int cVideo::getPlayState(void) { return VIDEO_PLAYING; diff --git a/generic-pc/video_lib.h b/generic-pc/video_lib.h index 3b075d4..e48aa71 100644 --- a/generic-pc/video_lib.h +++ b/generic-pc/video_lib.h @@ -177,6 +177,7 @@ class cVideo : public Thread /* set video_system */ int SetVideoSystem(int video_system, bool remember = true); + int GetVideoSystem(); int SetStreamType(VIDEO_FORMAT type); void SetSyncMode(AVSYNC_TYPE mode); bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };