ncm 三期三批: 歌曲对象瘦身(1324→608B)+滑动窗口(NCM_SONG_WINDOW=256, 取消1000截断支撑任意长度歌单)+播放快照解耦 — agent-251
- core/ncm_api.h: ncm_song_t 瘦身 id24/name128/art96/al96/pic256/dt int32 (1324B→608B) - appstate.c 滑动窗口: song_ids 全量 trackIds 索引(16384) + songs[256] 窗口感知 (song_valid 位图/window_base/滑窗 memmove 保留重叠), ensure_range 批网格(100)对齐 预取, songmeta.c 盘缓存 <cache_dir>/meta/<id>.bin (回滚/二次进入 0 网络请求) - playlist.c 触底分页退役→视口 ensure(±24 行), 占位行可直点(播放线程 fetch 物化), footer 改视口区间/总数 - 播放兼容: g_play.play_song 快照(mu), run_song 起播物化后全链路(下载/歌词/IPC META/ 播放页 UI)读快照——窗口滑出当前播放曲不崩; 边界 song_count→track_ids_count - 验证(0 真实请求): pagination_sim 全 PASS(5191 无截断/52 批); window_sim 6000 首 全程下滚 750 步视口全物化/song_detail 恰 60 次/回滚+0 请求/播放 fetch 不滑窗; core 宿主+qemu 全 PASS; mipsel -Wall -Wextra 0 warning, bss 2052068→1080900(-47%) - 未部署真机(设备音频线排查中, 部署留主会话)
This commit is contained in:
1 parent
d8898afa09
commit
997f89f879
18 files changed
+987
-209
No files matched your search
@@ -42,7 +42,9 @@ static void mock_songs(void)
|
||||
"Song Four", "Song Five", "Song Six" };
|
||||
static const char *ar[] = { "Artist A", "Artist B", "Artist C",
|
||||
"Artist D", "Artist E", "Artist F" };
|
||||
g_st.song_count = 6;
|
||||
g_st.song_count = 6; /* 滑窗模型:窗口 base=0,6 槽全有效(§17) */
|
||||
g_st.window_base = 0;
|
||||
g_st.track_ids_count = 6;
|
||||
g_st.active_playlist = 0;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
snprintf(g_st.songs[i].id, sizeof g_st.songs[i].id, "%ld", 1000L + i);
|
||||
@@ -51,6 +53,8 @@ static void mock_songs(void)
|
||||
snprintf(g_st.songs[i].album_name, sizeof g_st.songs[i].album_name, "Album %d", i + 1);
|
||||
g_st.songs[i].duration_ms = 180000 + i * 20000;
|
||||
g_st.songs[i].fee = (i == 3) ? 1 : 0;
|
||||
g_st.song_valid[i] = 1;
|
||||
g_st.song_ids[i] = 1000 + i;
|
||||
}
|
||||
ncm_strlcpy(g_st.cover_url, "http://p1.music.126.net/cover0.jpg", sizeof g_st.cover_url);
|
||||
g_st.playing_song = 0;
|
||||
@@ -139,6 +143,8 @@ int main(int argc, char **argv)
|
||||
g_play.cur_song = 0;
|
||||
g_play.pos_ms = 94000;
|
||||
g_play.dur_ms = 180000;
|
||||
g_play.play_song = g_st.songs[0]; /* 播放快照(§17) */
|
||||
g_play.play_song_valid = 1;
|
||||
pthread_mutex_unlock(&g_play.mu);
|
||||
} else if (strcmp(name, "settings") == 0) {
|
||||
g_st.logged_in = 1;
|
||||
@@ -162,8 +168,11 @@ int main(int argc, char **argv)
|
||||
snprintf(g_st.songs[i].album_name, sizeof g_st.songs[i].album_name, "%s", al[i]);
|
||||
g_st.songs[i].duration_ms = 180000 + i * 20000;
|
||||
g_st.songs[i].fee = 0;
|
||||
g_st.song_valid[i] = 1;
|
||||
g_st.song_ids[i] = 1000 + i;
|
||||
}
|
||||
g_st.song_count = 3;
|
||||
g_st.track_ids_count = 3;
|
||||
} else {
|
||||
mock_playlists();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user