| 1794 | } |
| 1795 | |
| 1796 | int ff_dca_core_parse(DCACoreDecoder *s, const uint8_t *data, int size) |
| 1797 | { |
| 1798 | int ret; |
| 1799 | |
| 1800 | s->ext_audio_mask = 0; |
| 1801 | s->xch_pos = s->xxch_pos = s->x96_pos = 0; |
| 1802 | |
| 1803 | if ((ret = init_get_bits8(&s->gb, data, size)) < 0) |
| 1804 | return ret; |
| 1805 | s->gb_in = s->gb; |
| 1806 | |
| 1807 | if ((ret = parse_frame_header(s)) < 0) |
| 1808 | return ret; |
| 1809 | if ((ret = alloc_sample_buffer(s)) < 0) |
| 1810 | return ret; |
| 1811 | if ((ret = parse_frame_data(s, HEADER_CORE, 0)) < 0) |
| 1812 | return ret; |
| 1813 | if ((ret = parse_optional_info(s)) < 0) |
| 1814 | return ret; |
| 1815 | |
| 1816 | // Workaround for DTS in WAV |
| 1817 | if (s->frame_size > size) |
| 1818 | s->frame_size = size; |
| 1819 | |
| 1820 | if (ff_dca_seek_bits(&s->gb, s->frame_size * 8)) { |
| 1821 | av_log(s->avctx, AV_LOG_ERROR, "Read past end of core frame\n"); |
| 1822 | if (s->avctx->err_recognition & AV_EF_EXPLODE) |
| 1823 | return AVERROR_INVALIDDATA; |
| 1824 | } |
| 1825 | |
| 1826 | return 0; |
| 1827 | } |
| 1828 | |
| 1829 | int ff_dca_core_parse_exss(DCACoreDecoder *s, const uint8_t *data, DCAExssAsset *asset) |
| 1830 | { |
no test coverage detected