正在显示
2 个修改的文件
包含
8 行增加
和
7 行删除
| @@ -1040,11 +1040,6 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) | @@ -1040,11 +1040,6 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) | ||
| 1040 | if ((ret = srs_avc_nalu_read_bit(&bs, seq_scaling_matrix_present_flag_i)) != ERROR_SUCCESS) { | 1040 | if ((ret = srs_avc_nalu_read_bit(&bs, seq_scaling_matrix_present_flag_i)) != ERROR_SUCCESS) { |
| 1041 | return ret; | 1041 | return ret; |
| 1042 | } | 1042 | } |
| 1043 | - if (seq_scaling_matrix_present_flag_i) { | ||
| 1044 | - ret = ERROR_HLS_DECODE_ERROR; | ||
| 1045 | - srs_error("sps the seq_scaling_matrix_present_flag invalid, i=%d, nb_scmpfs=%d. ret=%d", i, nb_scmpfs, ret); | ||
| 1046 | - return ret; | ||
| 1047 | - } | ||
| 1048 | } | 1043 | } |
| 1049 | } | 1044 | } |
| 1050 | } | 1045 | } |
| @@ -1084,11 +1079,17 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) | @@ -1084,11 +1079,17 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) | ||
| 1084 | if ((ret = srs_avc_nalu_read_uev(&bs, num_ref_frames_in_pic_order_cnt_cycle)) != ERROR_SUCCESS) { | 1079 | if ((ret = srs_avc_nalu_read_uev(&bs, num_ref_frames_in_pic_order_cnt_cycle)) != ERROR_SUCCESS) { |
| 1085 | return ret; | 1080 | return ret; |
| 1086 | } | 1081 | } |
| 1087 | - if (num_ref_frames_in_pic_order_cnt_cycle) { | 1082 | + if (num_ref_frames_in_pic_order_cnt_cycle < 0) { |
| 1088 | ret = ERROR_HLS_DECODE_ERROR; | 1083 | ret = ERROR_HLS_DECODE_ERROR; |
| 1089 | srs_error("sps the num_ref_frames_in_pic_order_cnt_cycle invalid. ret=%d", ret); | 1084 | srs_error("sps the num_ref_frames_in_pic_order_cnt_cycle invalid. ret=%d", ret); |
| 1090 | return ret; | 1085 | return ret; |
| 1091 | } | 1086 | } |
| 1087 | + for (int i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++) { | ||
| 1088 | + int32_t offset_for_ref_frame_i = -1; | ||
| 1089 | + if ((ret = srs_avc_nalu_read_uev(&bs, offset_for_ref_frame_i)) != ERROR_SUCCESS) { | ||
| 1090 | + return ret; | ||
| 1091 | + } | ||
| 1092 | + } | ||
| 1092 | } | 1093 | } |
| 1093 | 1094 | ||
| 1094 | int32_t max_num_ref_frames = -1; | 1095 | int32_t max_num_ref_frames = -1; |
| @@ -77,7 +77,7 @@ int srs_avc_nalu_read_uev(SrsBitBuffer* stream, int32_t& v) | @@ -77,7 +77,7 @@ int srs_avc_nalu_read_uev(SrsBitBuffer* stream, int32_t& v) | ||
| 77 | v = (1 << leadingZeroBits) - 1; | 77 | v = (1 << leadingZeroBits) - 1; |
| 78 | for (int i = 0; i < leadingZeroBits; i++) { | 78 | for (int i = 0; i < leadingZeroBits; i++) { |
| 79 | int32_t b = stream->read_bit(); | 79 | int32_t b = stream->read_bit(); |
| 80 | - v += b << (leadingZeroBits - 1); | 80 | + v += b << (leadingZeroBits - 1 - i); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | return ret; | 83 | return ret; |
-
请 注册 或 登录 后发表评论