mirror of
https://github.com/openharmony/third_party_ffmpeg.git
synced 2026-08-24 13:03:14 -04:00
!620 merge 61_0312 into OpenHarmony-6.1-Release
6.1优化rm关键帧判断
Created-by: xujifengwx
Commit-by: xujifengwx
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)
### 二、建议测试周期和提测地址
建议测试完成时间:xxxx.xx.xx
投产上线时间:xxxx.xx.xx
提测地址:CI环境/压测环境
测试账号:
### 三、变更内容
* 3.1 关联PR列表
* 3.2 数据库和部署说明
1. 常规更新
2. 重启unicorn
3. 重启sidekiq
4. 迁移任务:是否有迁移任务,没有写 "无"
5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"
* 3.4 其他技术优化内容(做了什么,变更了什么)
- 重构了 xxxx 代码
- xxxx 算法优化
* 3.5 废弃通知(什么字段、方法弃用?)
* 3.6 后向不兼容变更(是否有无法向后兼容的变更?)
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
自测测试结论:
### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
检查点:
| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx | 否 | 需要 | 不需要 |
| | | | |
接口测试:
性能测试:
并发测试:
其他:
See merge request: openharmony/third_party_ffmpeg!620
This commit is contained in:
@@ -690,6 +690,9 @@ static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stre
|
||||
AVIOContext *pb = s->pb;
|
||||
AVStream *st;
|
||||
uint32_t state=0xFFFFFFFF;
|
||||
#ifdef OHOS_OPT_COMPAT
|
||||
int64_t original_pos = 0;
|
||||
#endif
|
||||
|
||||
while(!avio_feof(pb)){
|
||||
int len, num, i;
|
||||
@@ -730,6 +733,9 @@ static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stre
|
||||
|
||||
if(state > (unsigned)0xFFFF || state <= 12)
|
||||
continue;
|
||||
#ifdef OHOS_OPT_COMPAT
|
||||
original_pos = avio_tell(pb);
|
||||
#endif
|
||||
len=state - 12;
|
||||
state= 0xFFFFFFFF;
|
||||
|
||||
@@ -744,6 +750,42 @@ static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stre
|
||||
if (mlti_id + num == st->id)
|
||||
break;
|
||||
}
|
||||
#ifdef OHOS_OPT_COMPAT
|
||||
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||
int64_t current_pos = avio_tell(pb);
|
||||
int64_t file_size = avio_size(pb);
|
||||
int64_t file_remain_len = file_size - current_pos;
|
||||
if (len < 0 || len > file_remain_len) {
|
||||
av_log(s, AV_LOG_ERROR, "rm_sync error, len=%d,"
|
||||
"cur_pos=%"PRId64", file_size=%"PRId64", file_remain_len=%"PRId64"\n",
|
||||
len, avio_tell(pb), file_size, file_remain_len);
|
||||
avio_seek(pb, original_pos, SEEK_SET);
|
||||
continue;
|
||||
}
|
||||
|
||||
int len_tmp = len;
|
||||
int type = avio_r8(pb) >> 6;
|
||||
len_tmp--;
|
||||
if(type != 3) {
|
||||
avio_skip(pb, 1);
|
||||
len_tmp--;
|
||||
}
|
||||
if(type != 1) {
|
||||
int len2 = get_num(pb, &len_tmp);
|
||||
(void)get_num(pb, &len_tmp);
|
||||
len_tmp--;
|
||||
file_remain_len = file_size - avio_tell(pb);
|
||||
if (len2 < 0 || len2 > file_remain_len || (type == 3 && len2 > len_tmp)) {
|
||||
av_log(s, AV_LOG_ERROR, "rm_sync err, len2=%d, file_remain_len=%"PRId64", type=%d, len_tmp=%d\n",
|
||||
len2, file_remain_len, type, len_tmp);
|
||||
avio_seek(pb, original_pos, SEEK_SET);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
avio_seek(pb, current_pos, SEEK_SET);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (i == s->nb_streams) {
|
||||
skip:
|
||||
/* skip packet if unknown number */
|
||||
|
||||
Reference in New Issue
Block a user