From 2ad3047c82b7a843981fdf994feea01ee3417f43 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 19 May 2018 19:21:22 +0200 Subject: [PATCH] use enum for setAVInput Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/acf02c7dbdf67efcde4bad16c146796aa5a1b64f Author: Jacek Jendrzej Date: 2018-05-19 (Sat, 19 May 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 8d502b7..4017b10 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -300,12 +300,9 @@ int image_to_mpeg2(const char *image_name, int fd) av_free(formatContext); return ret; } - +enum{ENCODER,AUX}; void setAVInput(int val) { - if (val != 0 && val != 1) - return; - int input_fd = open("/proc/stb/avs/0/input", O_WRONLY); if(input_fd){ const char *input[] = {"encoder", "aux"}; @@ -337,7 +334,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit) cVideo::~cVideo(void) { if(fd >= 0) - setAVInput(1); + setAVInput(AUX); if (standby_cec_activ && fd >= 0) SetCECState(true); @@ -634,14 +631,12 @@ void cVideo::Standby(unsigned int bOn) if (bOn) { closeDevice(); - if(fd < 0) - setAVInput(1); + setAVInput(AUX); } else { openDevice(); - if(fd >= 0) - setAVInput(0); + setAVInput(ENCODER); } video_standby = bOn; SetCECState(video_standby);