| 1051 | } |
| 1052 | |
| 1053 | static int parse_frame(DCAXllDecoder *s, const uint8_t *data, int size, DCAExssAsset *asset) |
| 1054 | { |
| 1055 | int ret; |
| 1056 | |
| 1057 | if ((ret = init_get_bits8(&s->gb, data, size)) < 0) |
| 1058 | return ret; |
| 1059 | if ((ret = parse_common_header(s)) < 0) |
| 1060 | return ret; |
| 1061 | if ((ret = parse_sub_headers(s, asset)) < 0) |
| 1062 | return ret; |
| 1063 | if ((ret = parse_navi_table(s)) < 0) |
| 1064 | return ret; |
| 1065 | if ((ret = parse_band_data(s)) < 0) |
| 1066 | return ret; |
| 1067 | |
| 1068 | if (s->frame_size * 8 > FFALIGN(get_bits_count(&s->gb), 32)) { |
| 1069 | unsigned int extradata_syncword; |
| 1070 | |
| 1071 | // Align to dword |
| 1072 | skip_bits_long(&s->gb, -get_bits_count(&s->gb) & 31); |
| 1073 | |
| 1074 | extradata_syncword = show_bits_long(&s->gb, 32); |
| 1075 | |
| 1076 | if (extradata_syncword == DCA_SYNCWORD_XLL_X) { |
| 1077 | s->x_syncword_present = 1; |
| 1078 | } else if ((extradata_syncword >> 1) == (DCA_SYNCWORD_XLL_X_IMAX >> 1)) { |
| 1079 | s->x_imax_syncword_present = 1; |
| 1080 | } |
| 1081 | } |
| 1082 | |
| 1083 | if (ff_dca_seek_bits(&s->gb, s->frame_size * 8)) { |
| 1084 | av_log(s->avctx, AV_LOG_ERROR, "Read past end of XLL frame\n"); |
| 1085 | return AVERROR_INVALIDDATA; |
| 1086 | } |
| 1087 | return ret; |
| 1088 | } |
| 1089 | |
| 1090 | static void clear_pbr(DCAXllDecoder *s) |
| 1091 | { |
no test coverage detected