diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-12 12:06:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-12 12:07:19 +0200 |
commit | 85bbe1dbd1cc2e72ea30958af9115b727e958b99 (patch) | |
tree | 5037671d3249a9ddcb072895524c1732669871dc /libavcodec/dca_parser.c | |
parent | acf4925f444636a828534ab47d0f86c21a7a9b4e (diff) | |
parent | 0670acc4f1c4ceb16968818a654e07a3f550a8c9 (diff) | |
download | ffmpeg-85bbe1dbd1cc2e72ea30958af9115b727e958b99.tar.gz |
Merge commit '0670acc4f1c4ceb16968818a654e07a3f550a8c9'
* commit '0670acc4f1c4ceb16968818a654e07a3f550a8c9':
dca_parser: Extend DTS core sync word and fix existing check
Conflicts:
libavcodec/dca_parser.c
See: e80b2b9c81716a5d9f559c04cfe69d76b04e4cd3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dca_parser.c')
-rw-r--r-- | libavcodec/dca_parser.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c index 26e2f50875..9dafe706e2 100644 --- a/libavcodec/dca_parser.c +++ b/libavcodec/dca_parser.c @@ -42,10 +42,10 @@ typedef struct DCAParseContext { #define IS_EXSS_MARKER(state) ((state & 0xFFFFFFFF) == DCA_SYNCWORD_SUBSTREAM) -#define IS_MARKER(state) (IS_CORE_MARKER(state) || IS_EXSS_MARKER(state)) +#define IS_MARKER(state) (IS_CORE_MARKER(state) || IS_EXSS_MARKER(state)) -#define CORE_MARKER(state) ((state >> 16) & 0xFFFFFFFF) -#define EXSS_MARKER(state) (state & 0xFFFFFFFF) +#define CORE_MARKER(state) ((state >> 16) & 0xFFFFFFFF) +#define EXSS_MARKER(state) (state & 0xFFFFFFFF) /** * Find the end of the current frame in the bitstream. @@ -66,7 +66,9 @@ 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)) { - if (!pc1->lastmarker || CORE_MARKER(state) == pc1->lastmarker || pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM) { + if (!pc1->lastmarker || + pc1->lastmarker == CORE_MARKER(state) || + pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM) { start_found = 1; if (IS_EXSS_MARKER(state)) pc1->lastmarker = EXSS_MARKER(state); @@ -82,7 +84,9 @@ static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf, for (; i < buf_size; i++) { pc1->size++; state = (state << 8) | buf[i]; - if (IS_MARKER(state) && (CORE_MARKER(state) == pc1->lastmarker || pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM)) { + if (IS_MARKER(state) && + (pc1->lastmarker == CORE_MARKER(state) || + pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM)) { if (pc1->framesize > pc1->size) continue; pc->frame_start_found = 0; |