mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avcodec/dca_parser: simplify state machine
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
054a2c9fdf
commit
1f7b67a1ca
@ -109,25 +109,25 @@ static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf,
|
|||||||
case DCA_SYNCWORD_CORE_LE:
|
case DCA_SYNCWORD_CORE_LE:
|
||||||
if (size == 2) {
|
if (size == 2) {
|
||||||
pc1->framesize = CORE_FRAMESIZE(STATE_LE(state));
|
pc1->framesize = CORE_FRAMESIZE(STATE_LE(state));
|
||||||
start_found = 2;
|
start_found = 4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DCA_SYNCWORD_CORE_14B_BE:
|
case DCA_SYNCWORD_CORE_14B_BE:
|
||||||
if (size == 4) {
|
if (size == 4) {
|
||||||
pc1->framesize = CORE_FRAMESIZE(STATE_14(state)) * 8 / 14 * 2;
|
pc1->framesize = CORE_FRAMESIZE(STATE_14(state)) * 8 / 14 * 2;
|
||||||
start_found = 2;
|
start_found = 4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DCA_SYNCWORD_CORE_14B_LE:
|
case DCA_SYNCWORD_CORE_14B_LE:
|
||||||
if (size == 4) {
|
if (size == 4) {
|
||||||
pc1->framesize = CORE_FRAMESIZE(STATE_14(STATE_LE(state))) * 8 / 14 * 2;
|
pc1->framesize = CORE_FRAMESIZE(STATE_14(STATE_LE(state))) * 8 / 14 * 2;
|
||||||
start_found = 2;
|
start_found = 4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DCA_SYNCWORD_SUBSTREAM:
|
case DCA_SYNCWORD_SUBSTREAM:
|
||||||
if (size == 6) {
|
if (size == 6) {
|
||||||
pc1->framesize = EXSS_FRAMESIZE(state);
|
pc1->framesize = EXSS_FRAMESIZE(state);
|
||||||
start_found = 2;
|
start_found = 4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -136,11 +136,8 @@ static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pc1->lastmarker == DCA_SYNCWORD_CORE_BE) {
|
if (start_found == 2 && IS_EXSS_MARKER(state) &&
|
||||||
if (pc1->framesize > size + 2)
|
pc1->framesize <= size + 2) {
|
||||||
continue;
|
|
||||||
|
|
||||||
if (start_found == 2 && IS_EXSS_MARKER(state)) {
|
|
||||||
pc1->framesize = size + 2;
|
pc1->framesize = size + 2;
|
||||||
start_found = 3;
|
start_found = 3;
|
||||||
continue;
|
continue;
|
||||||
@ -153,7 +150,6 @@ static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf,
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (pc1->framesize > size)
|
if (pc1->framesize > size)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user