diff --git a/rootfs/link/bin/Encoder b/rootfs/link/bin/Encoder index cde4911..6609257 100644 Binary files a/rootfs/link/bin/Encoder and b/rootfs/link/bin/Encoder differ diff --git a/rootfs/link/config/verLogs.json b/rootfs/link/config/verLogs.json index f9d614d..cdac07d 100644 --- a/rootfs/link/config/verLogs.json +++ b/rootfs/link/config/verLogs.json @@ -1,4 +1,12 @@ [ + { + "version": "2.3.0 build 20230630", + "logs": [ + "修正无效推流地址导致的内存占用增加问题", + "修正输出设置页面,播放地址显示问题", + "新增通过升级包方式升级后恢复用户设置功能" + ] + }, { "version": "2.2.0 build 20230531", "logs": [ diff --git a/rootfs/link/config/version.json b/rootfs/link/config/version.json index 1baf278..3002c78 100644 --- a/rootfs/link/config/version.json +++ b/rootfs/link/config/version.json @@ -1,5 +1,5 @@ { "app": "2.0.0 build 20220512_869", "sdk": "2.0.0 build 20220518_20716", - "sys": "2.2.0 build 20230531" + "sys": "2.3.0 build 20230630" } diff --git a/rootfs/link/shell/enc.sh b/rootfs/link/shell/enc.sh index af8e399..8826897 100644 --- a/rootfs/link/shell/enc.sh +++ b/rootfs/link/shell/enc.sh @@ -1,8 +1,10 @@ -/link/shell/tester.sh & -/link/shell/trans.sh & while [ true ] do -pkill Monitor +if [ -f "/root/usb/Tester" ]; then +chmod 777 /root/usb/Tester +/root/usb/Tester +else /link/bin/Encoder +fi sleep 2 done diff --git a/rootfs/link/shell/init/filesystem.sh b/rootfs/link/shell/init/filesystem.sh index 9255c0c..479ccba 100644 --- a/rootfs/link/shell/init/filesystem.sh +++ b/rootfs/link/shell/init/filesystem.sh @@ -18,10 +18,11 @@ if [ -b /dev/mmcblk0p6 ]; then mnt=`df -h | grep /dev/mmcblk0p6 | wc -l` if [ "$mnt" == "0" ];then echo -e "\ny" | mkfs.ext4 -T largefile /dev/mmcblk0p6 - if [ ! -b /dev/sda1 ];then - /bin/mount -o rw,sync,barrier=0 /dev/mmcblk0p6 /root/usb - fi fi fi + umount -f /root/usb/ + if [ ! -b /dev/sda1 ];then + /bin/mount -o rw,sync,barrier=0 /dev/mmcblk0p6 /root/usb + fi fi diff --git a/rootfs/link/shell/init/service.sh b/rootfs/link/shell/init/service.sh index 95f2cb0..cf9ab58 100644 --- a/rootfs/link/shell/init/service.sh +++ b/rootfs/link/shell/init/service.sh @@ -1,6 +1,8 @@ . /link/shell/util/func.sh jopen /link/config/service.json +/link/bin/rtc -g time + if [ `jget telnet` == "true" ]; then /usr/sbin/telnetd fi diff --git a/rootfs/link/shell/update.sh b/rootfs/link/shell/update.sh index cb65493..e91a62c 100644 --- a/rootfs/link/shell/update.sh +++ b/rootfs/link/shell/update.sh @@ -1,4 +1,8 @@ if [ ! -z "$(ls -A /link/update)" ]; then + + cp -rd /link/config /tmp/history_config + rm -rf /tmp/history_config/misc/timezone/zoneinfo + mv /link/update/* /link/update/update.tar tar -xof /link/update/update.tar -C / @@ -30,6 +34,13 @@ if [ ! -z "$(ls -A /link/update)" ]; then rm /link/update/* + if [ ! -f "/link/config/auto/no_user_setting" ]; then + /usr/php/bin/php /link/web/link/timer/healConf.php + fi + + rm -rf /tmp/history_config + rm /link/config/auto/no_user_setting + if [ -f "/link/config/reboot" ]; then rm /link/config/reboot reboot diff --git a/rootfs/link/shell/update.sh_bak b/rootfs/link/shell/update.sh_bak new file mode 100644 index 0000000..7f9e94c --- /dev/null +++ b/rootfs/link/shell/update.sh_bak @@ -0,0 +1,54 @@ +if [ ! -z "$(ls -A /link/update)" ]; then + + mkdir /tmp/history/misc/timezone + cp -rd /link/config/config.json /link/config/push.json /link/config/record.json /tmp/history/ + cp -rd /link/config/button.json /link/config/defLays.json /link/config/port.json /tmp/history/ + cp -rd /link/config/lang.json /link/config/videoBuffer.json /link/config/ntp.json /tmp/history/ + cp -rd /link/config/uart.json /link/config/intercom.json /tmp/history/ + cp -rd /link/config/misc/timezone/tzselect.json /tmp/history/misc/timezone/ + + mv /link/update/* /link/update/update.tar + tar -xof /link/update/update.tar -C / + + sleep 1 + if [ -c "/dev/mtd1" ]; then + if [ -f "/link/update/kernel" ]; then + flash_erase /dev/mtd1 0 0 + nandwrite -p /dev/mtd1 /link/update/kernel + fi + if [ -f "/link/update/logo.bin" ]; then + flash_erase /dev/mtd2 0 0 + nandwrite -p /dev/mtd2 /link/update/logo.bin + fi + if [ -f "/link/update/logo.jpg" ]; then + flash_erase /dev/mtd3 0 0 + nandwrite -p /dev/mtd3 /link/update/logo.jpg + fi + else + if [ -f "/link/update/kernel" ]; then + dd if=/link/update/kernel of=/dev/mmcblk0p2 + fi + if [ -f "/link/update/logo.bin" ]; then + dd if=/link/update/logo.bin of=/dev/mmcblk0p3 + fi + if [ -f "/link/update/logo.jpg" ]; then + dd if=/link/update/logo.jpg of=/dev/mmcblk0p4 + fi + fi + + rm /link/update/* + + if [ -f "/link/config/reboot" ]; then + rm /link/config/reboot + reboot + fi +fi + +if [ -f "/link/shell/runOnce.sh" ]; then + chmod 777 /link/shell/runOnce.sh + /link/shell/runOnce.sh + rm /link/shell/runOnce.sh +fi + + + diff --git a/rootfs/link/web/func.php b/rootfs/link/web/func.php index e0985ce..7785524 100644 --- a/rootfs/link/web/func.php +++ b/rootfs/link/web/func.php @@ -280,9 +280,9 @@ function changeType() { exec( 'echo '.$_POST[ 'type' ].' > /link/config/fac' ); exec( 'cp /link/fac/'.$_POST[ 'type' ].'/* /link/ -rd' ); exec( 'chmod 777 /link -R' ); - exec( 'pkill Encoder' ); exec('rm -f /link/config/record.json'); exec('rm -rf /link/config/auto/*'); + exec( 'pkill Encoder' ); } function delFile() { @@ -446,8 +446,8 @@ function checkHelpNet() { function checkUpdate() { global $result,$server; - - $fac = file_get_contents("/link/config/fac"); + $hardware = json_decode(file_get_contents('/link/config/hardware.json'), true); + $fac = $hardware["fac"]; $fac = str_replace("\n","",$fac); if(is_null($fac) || $fac == "") { $result->error = "获取机型错误Error getting model"; @@ -466,7 +466,8 @@ function checkUpdate() { function getPatch() { global $result,$server; - $fac = file_get_contents("/link/config/fac"); + $hardware = json_decode(file_get_contents('/link/config/hardware.json'), true); + $fac = $hardware["fac"]; $fac = str_replace("\n","",$fac); if(is_null($fac) || $fac == "") { $result->error = "获取机型错误Error getting model"; @@ -484,7 +485,8 @@ function getPatch() { function getPatchBySn() { global $result,$server; - $fac = file_get_contents("/link/config/fac"); + $hardware = json_decode(file_get_contents('/link/config/hardware.json'), true); + $fac = $hardware["fac"]; $fac = str_replace("\n","",$fac); if(is_null($fac) || $fac == "") { $result->error = "获取机型错误Error getting model"; @@ -500,7 +502,8 @@ function getPatchBySn() { function getAliase() { global $result,$server; - $fac = file_get_contents("/link/config/fac"); + $hardware = json_decode(file_get_contents('/link/config/hardware.json'), true); + $fac = $hardware["fac"]; $fac = str_replace("\n","",$fac); if(is_null($fac) || $fac == "") { $result->error = "获取机型错误Error getting model"; diff --git a/rootfs/link/web/link/timer/healConf.php b/rootfs/link/web/link/timer/healConf.php new file mode 100644 index 0000000..177eb05 --- /dev/null +++ b/rootfs/link/web/link/timer/healConf.php @@ -0,0 +1,77 @@ + $value) { + if (is_array($value) && is_array($currentConfig[$key]) || + is_object($value) && is_object($currentConfig[$key]) + ) { + $level++; + copyUserSettings($value, $currentConfig[$key],$level); + } else { + $currentConfig[$key] = $value; + } + } + } elseif (is_object($historyConfig) && is_object($currentConfig)) { + + foreach ($historyConfig as $key => $value) { + if (isset($currentConfig->$key)) { + if (is_array($value) && is_array($currentConfig->$key) || + is_object($value) && is_object($currentConfig->$key) + ) { + $level++; + copyUserSettings($value, $currentConfig->$key,$level); + } else { + $currentConfig->$key = $value; + } + } + } + } +} + +$configFiles = getConfFiles('/tmp/history_config'); +foreach ($configFiles as $historyFile) { + $currentFile = str_replace("/tmp/history_config/","/link/config/",$historyFile); + if(md5_file($historyFile) == md5_file($currentFile)) + continue; + + if(!strpos($currentFile, ".json") || strpos($currentFile, "version.json") || + strpos($currentFile, "net.json") || strpos($currentFile, "net2.json") || strpos($currentFile, "netEx.json")) + continue; + + echo $currentFile."\n"; + + $historyCtx = json_decode(file_get_contents($historyFile)); + $currentCtx = json_decode(file_get_contents($currentFile)); + + copyUserSettings($historyCtx,$currentCtx); + + if(empty($currentCtx)) + continue; + + file_put_contents($currentFile, json_encode($currentCtx, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); + exec("sync"); +} \ No newline at end of file diff --git a/rootfs/link/web/mix.php b/rootfs/link/web/mix.php index ed903ca..3e38527 100644 --- a/rootfs/link/web/mix.php +++ b/rootfs/link/web/mix.php @@ -153,6 +153,7 @@ include("head.php"); + diff --git a/rootfs/link/web/stream.php b/rootfs/link/web/stream.php index f278cc6..87848fa 100644 --- a/rootfs/link/web/stream.php +++ b/rootfs/link/web/stream.php @@ -737,22 +737,30 @@ else 频道名称 channel name -
- 主码流标识 - Main Suffix +
+
+
+ 主码流标识 + Main Suffix +
+
+ 主流地址 + Main URL +
+
-
- 主流地址 - Main URL -
-
- 辅码流标识 - Sub Suffix +
+
+
+ 辅码流标识 + Sub Suffix +
+
+ 辅流地址 + Sub URL +
+
-
- 辅流地址 - Sub URL -

@@ -760,20 +768,27 @@ else
-
- +
+
+
+ +
+
+
+
+
-
-
-
-
-
- + +
+
+
+ +
+
+
+
+
-
-
-
-

@@ -888,13 +903,15 @@ else } ); } - function getport(list){ + function getport(list,type){ if(list[2]!=list[0]) return ":"+list[2]; else if(list[1]!=list[0]) return ":"+list[1]; - else - return list[0]; + else if((type == "http" && list[0] == 80) || (type == "rtsp" && list[0] == 554) || (type == "rtmp" && list[0] == 1935) || (type == "httpts" && list[0] == 8090)) + return ""; + else + return ":"+list[0]; } function transURL(str) @@ -906,8 +923,8 @@ else var url=list[i]; if(url.indexOf("http")==0){ if(url.indexOf("///live")>0){ - var port=getport(portCfg.http); - var port2=getport(portCfg.httpts); + var port=getport(portCfg.http,"http"); + var port2=getport(portCfg.httpts,"httpts"); if(port!="" || port2!=""){ if(port!="" && port2=="") port2=":"+portCfg.httpts[0]; @@ -917,20 +934,20 @@ else } } else{ - var port=getport(portCfg.http); - url=url.replace("///","//"+ip+":"+port+"/"); + var port=getport(portCfg.http,"http"); + url=url.replace("///","//"+ip+port+"/"); } } else if(url.indexOf("rtmp")==0){ - var port=getport(portCfg.rtmp); - url=url.replace("///","//"+ip+":"+port+"/"); + var port=getport(portCfg.rtmp,"rtmp"); + url=url.replace("///","//"+ip+port+"/"); } else if(url.indexOf("rtsp")==0){ - var port=getport(portCfg.rtsp); + var port=getport(portCfg.rtsp,"rtsp"); if(url.indexOf("@/") > 0) - url=url.replace("@/","@"+ip+":"+port+"/"); + url=url.replace("@/","@"+ip+port+"/"); else - url=url.replace("///","//"+ip+":"+port+"/"); + url=url.replace("///","//"+ip+port+"/"); } else if(url.indexOf("srt")==0){ url=url.replace("//:","//"+ip+":"); diff --git a/rootfs/link/web/upload.php b/rootfs/link/web/upload.php index a3303fe..76963e0 100644 --- a/rootfs/link/web/upload.php +++ b/rootfs/link/web/upload.php @@ -22,26 +22,25 @@ function upload() $hardware2 = json_decode(file_get_contents("/link/config/hardware.json"),true); $fac2 = $hardware2["fac"]; if($fac1 != $fac2) - $up = "-1"; + $up = "-1"; // 升级包机型不匹配 if($up == "0") { if(file_exists("/tmp/tmp/allow.json")) { - $allow = json_decode(file_get_contents("/tmp//tmp/allow.json"),true); + $allow = json_decode(file_get_contents("/tmp/tmp/allow.json"),true); $allow_version = $allow["allow"]; $sys = json_decode(file_get_contents("/link/config/version.json"),true); $sys_ary = explode(" ",$sys["sys"]); $cur_version = $sys_ary[2]; if(intval($allow_version) >= intval($cur_version)) - $up = "-2"; + $up = "-2"; //升级包与系统版本不匹配 } } } if($up != "0") exec("rm /link/update/update.tar"); - echo '{"upload":"'.$up.'"}'; } } diff --git a/rootfs/usr/lib/libLinkBase.so.1.0.0 b/rootfs/usr/lib/libLinkBase.so.1.0.0 index 7f80e98..7e1c4c4 100644 Binary files a/rootfs/usr/lib/libLinkBase.so.1.0.0 and b/rootfs/usr/lib/libLinkBase.so.1.0.0 differ diff --git a/rootfs/usr/lib/libLinkIO.so.1.0.0 b/rootfs/usr/lib/libLinkIO.so.1.0.0 index b93f251..6cc3695 100644 Binary files a/rootfs/usr/lib/libLinkIO.so.1.0.0 and b/rootfs/usr/lib/libLinkIO.so.1.0.0 differ diff --git a/rootfs/usr/lib/libLinkStream.so.1.0.0 b/rootfs/usr/lib/libLinkStream.so.1.0.0 index a36f08a..73386bc 100644 Binary files a/rootfs/usr/lib/libLinkStream.so.1.0.0 and b/rootfs/usr/lib/libLinkStream.so.1.0.0 differ