Advertisement
Guest User

Untitled

a guest
Sep 27th, 2022
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. Data\reserve.cs
  2. 連続した録画を空きがあれば別チューナーで予約する
  3. 156行目を変更
  4. name not in (select tuner from reserve where {1} <= end and {2} >= start and status & {3})
  5.  
  6. Streaming\Encoder.cs
  7. パイプライターとパイプリーダーを定義 //字幕用
  8. 13-14行目の間に追加
  9. BinaryReader reader;
  10. BinaryWriter pwriter;
  11. BinaryReader preader;
  12. BinaryWriter writer;
  13.  
  14. tsreadexを起動 //字幕用
  15. 21行目var p = new Process();の上に追加
  16. var p1 = new Process();
  17. p1.StartInfo.FileName = "cmd.exe";
  18. p1.StartInfo.Arguments = "/c tsreadex -x 18/38/39 -n -1 -a 13 -b 5 -c 1 -u 1 -d 13 -";
  19. p1.StartInfo.UseShellExecute = false;
  20. p1.StartInfo.CreateNoWindow = window;
  21. p1.StartInfo.RedirectStandardInput = true;
  22. p1.StartInfo.RedirectStandardOutput = true;
  23.  
  24. p1.Start();
  25.  
  26. var pをp2にリネーム //わかりやすさのためなので全部pのままでも可、字幕用
  27. 21-31行目を変更
  28. var p2 = new Process();
  29. p2.StartInfo.WorkingDirectory = workDir;
  30. p2.StartInfo.FileName = encoder;
  31. p2.StartInfo.Arguments = option;
  32. p2.StartInfo.UseShellExecute = false;
  33. p2.StartInfo.CreateNoWindow = window;
  34. p2.StartInfo.RedirectStandardInput = true;
  35. p2.StartInfo.RedirectStandardOutput = true;
  36.  
  37. p2.Start();
  38. process = p2;
  39.  
  40. パイプライターとパイプリーダーを宣言して標準入出力を設定 //エンコーダの前にtsreadexを通す、字幕用
  41. 33-34行目の間に追加、33-34行目を変更
  42. reader = new BinaryReader(p2.StandardOutput.BaseStream);
  43. pwriter = new BinaryWriter(p2.StandardInput.BaseStream);
  44. preader = new BinaryReader(p1.StandardOutput.BaseStream);
  45. writer = new BinaryWriter(p1.StandardInput.BaseStream);
  46. Interlocked.Increment(ref ready);
  47.  
  48. tsreadexからエンコーダへデータを送信 //字幕用
  49. 37行目「//エンコーダの変換が止まってないか監視するスレッド」の上に追加
  50. Task.Factory.StartNew(() =>
  51. {
  52. try
  53. {
  54. var buf = new byte[188 * 1024];
  55.  
  56. while (true)
  57. {
  58. var count = preader.Read(buf, 0, buf.Length);
  59.  
  60. if (count > 0)
  61. pwriter.Write(buf, 0, count);
  62. else
  63. break;
  64. }
  65. }
  66. catch (Exception ex)
  67. {
  68. Debug.WriteLine("ライブ→エンコーダでエラーが発生... " + ex.Message);
  69. }
  70.  
  71. if (pwriter != null) pwriter.Close();
  72. pwriter = null;
  73.  
  74. }, TaskCreationOptions.AttachedToParent);
  75.  
  76. パイプライターとパイプリーダーを終了させる //字幕用
  77. 104-105行目の間に追加
  78. if (reader != null) reader.Close();
  79. if (pwriter != null) pwriter.Close();
  80. if (preader != null) preader.Close();
  81. if (writer != null) writer.Close();
  82.  
  83. Streaming\VideoStreamReader.cs
  84. ライブ視聴開始時にスリープを抑止 //BonDriverProxyExを利用なら不要
  85. 43行目Interlocked.Increment(ref ready);の下に追加
  86. SleepState.Stop(true);
  87.  
  88. ライブ視聴終了時にスリープ抑止を解除 //BonDriverProxyExを利用なら不要
  89. 75行目Interlocked.Decrement(ref ready);の上に追加
  90. SleepState.Stop(false);
  91.  
  92. サブフォルダのTSファイルも再生可能にする
  93. 106行目を変更
  94. var path = Directory.GetFiles(AppDefine.Main.Data["record.folder"], rec.File, SearchOption.AllDirectories)[0];
  95.  
  96. 録画視聴開始時にスリープを抑止
  97. 123行目Interlocked.Increment(ref ready);の下に追加
  98. SleepState.Stop(true);
  99.  
  100. 録画視聴終了時にスリープ抑止を解除
  101. 133行目Interlocked.Decrement(ref ready);の上に追加
  102. SleepState.Stop(false);
  103.  
  104. Web\WebApi.cs
  105. サブフォルダのTSファイルも削除可能にする //あえて変更しなければサブフォルダのTSファイルは削除できないままなのでフォルダで整理したものを削除したくない場合は変えないほうがいい
  106. 325行目を変更
  107. var file = Directory.GetFiles(AppDefine.Main.Data["record.folder"], record.File, SearchOption.AllDirectories)[0];
  108.  
  109. サブフォルダのTSファイルもファイルチェック可能にする
  110. 336行目を変更
  111. var files = Directory.GetFiles(recFolder, "*.ts", SearchOption.AllDirectories);
  112.  
  113. サブフォルダのTSファイルも登録する
  114. 404行目を変更
  115. var files = Directory.GetFiles(AppDefine.Main.Data["record.folder"], "*.ts", SearchOption.AllDirectories);
  116.  
  117. EpgUpdater.cs
  118. 番組表更新開始時にスリープを抑止しない //BonDriverProxyExを利用の場合
  119. 45行目を削除
  120. SleepState.Stop(true);
  121.  
  122. 番組表更新終了時にスリープ抑止を解除しない //BonDriverProxyExを利用の場合
  123. SleepState.Stop(false);
  124.  
  125. Recorder.cs
  126. GetNextReserveTime()関数を削除 //終了マージンをマイナスにしたい場合
  127. 43-50行目を削除
  128. 「//次の予約の時間を取得」からpublic void Start()の上まで
  129.  
  130. 連続した録画があっても終了マージンを変更しない //終了マージンをマイナスにしたい場合
  131. 70-72行目を削除
  132. 「//次の予約と現在の予約の間がマージン以上空いていたらマージンを0にする」からif (reserve.EndTime - margin < DateTime.Now)の上まで
  133.  
  134. 録画開始時にスリープを抑止しない //BonDriverProxyExを利用の場合
  135. 221行目を削除
  136. SleepState.Stop(true);
  137.  
  138. 録画終了時にスリープ抑止を解除しない //BonDriverProxyExを利用の場合
  139. 306行目を削除
  140. SleepState.Stop(false);
  141.  
  142. Tvmaid.csproj
  143. DynamicJsonを相対パスで参照する
  144. 64行目を変更
  145. <HintPath>..\lib\
  146.  
  147. System.Data.SQLiteを相対パスで参照する
  148. 71行目を変更
  149. <HintPath>..\lib\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement