Skip to content

Commit

Permalink
fix(emby2Alist): 修复转码切换逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
chen3861229 committed Jun 29, 2024
1 parent dabdb4d commit 24a72e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 6 additions & 0 deletions emby2Alist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ date: 2021/09/06 22:00:00

### 文章更新记录

#### 2024-06-29

1.修复 windows 下的路径转义问题

2.移除转码切换逻辑中的 StartTimeTicks 错误判断,目前只以选择的码率是否小于原始码率判断覆盖走转码

#### 2024-06-25

1.修复图片和书籍等类型没有 MediaSources 字段导致的 Sync 客户端下载 API 回退源服务中转 bug
Expand Down
17 changes: 7 additions & 10 deletions emby2Alist/nginx/conf.d/emby.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,13 @@ async function transferPlaybackInfo(r) {
source.XRouteMode = routeMode; // for debug
if (util.ROUTE_ENUM.redirect == routeMode) {
if (!transcodeConfig.redirectTransOptEnable) source.SupportsTranscoding = false;
// first priority is user clients choice video bitrate < source.Bitrate
const maxStreamingBitrate = parseInt(r.args.MaxStreamingBitrate);
if (r.args.StartTimeTicks !== "0" && maxStreamingBitrate < source.Bitrate) {
r.warn(`playback started swich redirect to transcode by opt`);
modifyDirecPlaySupports(source, false);
}
// cover routeMode
// source.TranscodingUrl is important, sometimes SupportsTranscoding true but it's empty
if (!isStrm && r.args.StartTimeTicks === "0" && source.SupportsTranscoding && source.TranscodingUrl) {
// if (source.AutoOpenLiveStream === "true" && source.SupportsTranscoding) {
// 1. first priority is user clients choice video bitrate < source.Bitrate
// 2. strict cover routeMode, do't use r.args.StartTimeTicks === "0"
// 3. source.TranscodingUrl is important, sometimes SupportsTranscoding true but it's empty
// 4. ensure transcoding experience, disable STRM file transcode, because clients 1 ts part only wait 10s forced disconnection
const maxStreamingBitrate = parseInt(r.args.MaxStreamingBitrate);
if (!isStrm && maxStreamingBitrate < source.Bitrate
&& source.SupportsTranscoding && source.TranscodingUrl) {
r.warn(`client reported and server judgment to transcode, cover routeMode`);
source.XRouteMode = util.ROUTE_ENUM.transcode; // for debug
modifyDirecPlaySupports(source, false);
Expand Down

0 comments on commit 24a72e7

Please sign in to comment.