diff options
Diffstat (limited to 'libavcodec/dca_parser.c')
-rw-r--r-- | libavcodec/dca_parser.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c index 401402d..9797760 100644 --- a/libavcodec/dca_parser.c +++ b/libavcodec/dca_parser.c @@ -5,20 +5,20 @@ * Copyright (C) 2006 Benjamin Larsson * Copyright (C) 2007 Konstantin Shishkov * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -38,7 +38,7 @@ typedef struct DCAParseContext { #define IS_MARKER(state, i, buf, buf_size) \ ((state == DCA_SYNCWORD_CORE_14B_LE && (i < buf_size - 2) && (buf[i + 1] & 0xF0) == 0xF0 && buf[i + 2] == 0x07) || \ (state == DCA_SYNCWORD_CORE_14B_BE && (i < buf_size - 2) && buf[i + 1] == 0x07 && (buf[i + 2] & 0xF0) == 0xF0) || \ - state == DCA_SYNCWORD_CORE_LE || state == DCA_SYNCWORD_CORE_BE) + state == DCA_SYNCWORD_CORE_LE || state == DCA_SYNCWORD_CORE_BE || state == DCA_SYNCWORD_SUBSTREAM) /** * Find the end of the current frame in the bitstream. @@ -59,11 +59,7 @@ static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf, for (i = 0; i < buf_size; i++) { state = (state << 8) | buf[i]; if (IS_MARKER(state, i, buf, buf_size)) { - if (pc1->lastmarker && state == pc1->lastmarker) { - start_found = 1; - i++; - break; - } else if (!pc1->lastmarker) { + if (!pc1->lastmarker || state == pc1->lastmarker || pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM) { start_found = 1; pc1->lastmarker = state; i++; @@ -78,7 +74,7 @@ static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf, state = (state << 8) | buf[i]; if (state == DCA_SYNCWORD_SUBSTREAM && !pc1->hd_pos) pc1->hd_pos = pc1->size; - if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size)) { + if (IS_MARKER(state, i, buf, buf_size) && (state == pc1->lastmarker || pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM)) { if (pc1->framesize > pc1->size) continue; pc->frame_start_found = 0; @@ -111,7 +107,7 @@ static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration, if (buf_size < 12) return AVERROR_INVALIDDATA; - if ((ret = ff_dca_convert_bitstream(buf, 12, hdr, 12)) < 0) + if ((ret = avpriv_dca_convert_bitstream(buf, 12, hdr, 12)) < 0) return ret; init_get_bits(&gb, hdr, 96); |