diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 0255e77..cfe0222 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -462,7 +462,6 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, mAudioStream = 0; //create playback path - char file[400] = {""}; bool isHTTP = false; if(!strncmp("http://", filename, 7)) @@ -493,10 +492,6 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, { isHTTP = true; } - else - strcat(file, "file://"); - - strcat(file, filename); if (isHTTP) uri = g_uri_escape_string(filename, G_URI_RESERVED_CHARS_GENERIC_DELIMITERS, true); diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 16da567..1c1ecee 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -161,6 +161,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit) } else devnum = unit; fd = -1; + hdmiFd = -1; standby_cec_activ = autoview_cec_activ = false; openDevice(); } @@ -787,9 +788,21 @@ bool cVideo::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType) physicalAddress[0] = 0x10; physicalAddress[1] = 0x00; logicalAddress = 1; - deviceType = 1; /* default: recorder */ + + if (_deviceType == VIDEO_HDMI_CEC_MODE_OFF) + { + if (hdmiFd >= 0) { + close(hdmiFd); + hdmiFd = -1; + } + return false; + } + else + deviceType = _deviceType; + + if (hdmiFd == -1) + hdmiFd = open("/dev/cec0", O_RDWR | O_CLOEXEC); - hdmiFd = open("/dev/cec0", O_RDWR | O_CLOEXEC); if (hdmiFd >= 0) { __u32 monitor = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER; @@ -863,6 +876,7 @@ bool cVideo::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType) GetCECAddressInfo(); + return true; } void cVideo::GetCECAddressInfo() diff --git a/libarmbox/video_lib.h b/libarmbox/video_lib.h index 2090ab5..15224bc 100644 --- a/libarmbox/video_lib.h +++ b/libarmbox/video_lib.h @@ -118,11 +118,10 @@ typedef enum { VIDEO_STD_MAX = VIDEO_STD_AUTO } VIDEO_STD; -/* not used, for dummy functions */ typedef enum { VIDEO_HDMI_CEC_MODE_OFF = 0, - VIDEO_HDMI_CEC_MODE_TUNER, - VIDEO_HDMI_CEC_MODE_RECORDER + VIDEO_HDMI_CEC_MODE_TUNER = 3, + VIDEO_HDMI_CEC_MODE_RECORDER = 1 } VIDEO_HDMI_CEC_MODE; typedef enum