高清/标清切换慢 优化
This commit is contained in:
parent
6cc00ca348
commit
e16c7fa935
@ -814,6 +814,7 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
// 切换清晰度的方法,后续补充具体实现
|
// 切换清晰度的方法,后续补充具体实现
|
||||||
void onQualityChanged(String quality) async {
|
void onQualityChanged(String quality) async {
|
||||||
state.currentQuality.value = quality;
|
state.currentQuality.value = quality;
|
||||||
|
state.isLoading.value = true; // 立即显示加载状态
|
||||||
TalkExpectReq talkExpectReq = StartChartManage().getDefaultTalkExpect();
|
TalkExpectReq talkExpectReq = StartChartManage().getDefaultTalkExpect();
|
||||||
final audioType = talkExpectReq.audioType;
|
final audioType = talkExpectReq.audioType;
|
||||||
int width = 864;
|
int width = 864;
|
||||||
@ -837,6 +838,8 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 立即重置解码器
|
||||||
|
await _resetDecoderForNewStream(width, height);
|
||||||
/// 修改发送预期数据
|
/// 修改发送预期数据
|
||||||
StartChartManage().changeTalkExpectDataTypeAndReStartTalkExpectMessageTimer(talkExpect: talkExpectReq);
|
StartChartManage().changeTalkExpectDataTypeAndReStartTalkExpectMessageTimer(talkExpect: talkExpectReq);
|
||||||
|
|
||||||
@ -870,7 +873,7 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 等待一小段时间确保资源释放完成
|
// 等待一小段时间确保资源释放完成
|
||||||
await Future.delayed(Duration(milliseconds: 100));
|
await Future.delayed(Duration(milliseconds: 50));
|
||||||
|
|
||||||
// 创建新的解码器配置
|
// 创建新的解码器配置
|
||||||
final config = VideoDecoderConfig(
|
final config = VideoDecoderConfig(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user