Commit 89646284 authored by Rafaël Carré's avatar Rafaël Carré

AAC packetizer: deindent state machine switch

parent 7e52cd8a
...@@ -895,15 +895,9 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block) ...@@ -895,15 +895,9 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block)
block_BytestreamPush(&p_sys->bytestream, *pp_block); block_BytestreamPush(&p_sys->bytestream, *pp_block);
for (;;) for (;;) switch(p_sys->i_state) {
{
switch(p_sys->i_state)
{
case STATE_NOSYNC: case STATE_NOSYNC:
while (block_PeekBytes(&p_sys->bytestream, p_header, 2) while (block_PeekBytes(&p_sys->bytestream, p_header, 2) == VLC_SUCCESS) {
== VLC_SUCCESS)
{
/* Look for sync word - should be 0xfff(adts) or 0x2b7(loas) */ /* Look for sync word - should be 0xfff(adts) or 0x2b7(loas) */
if (p_header[0] == 0xff && (p_header[1] & 0xf6) == 0xf0) { if (p_header[0] == 0xff && (p_header[1] & 0xf6) == 0xf0) {
if (p_sys->i_type != TYPE_ADTS) if (p_sys->i_type != TYPE_ADTS)
...@@ -1022,13 +1016,10 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block) ...@@ -1022,13 +1016,10 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block)
/* Skip the ADTS/LOAS header */ /* Skip the ADTS/LOAS header */
block_SkipBytes(&p_sys->bytestream, p_sys->i_header_size); block_SkipBytes(&p_sys->bytestream, p_sys->i_header_size);
if (p_sys->i_type == TYPE_ADTS) {
/* Copy the whole frame into the buffer */ /* Copy the whole frame into the buffer */
block_GetBytes(&p_sys->bytestream, p_buf, p_sys->i_frame_size); block_GetBytes(&p_sys->bytestream, p_buf, p_sys->i_frame_size);
} else { if (p_sys->i_type != TYPE_ADTS) { /* parse/extract the whole frame */
assert(p_sys->i_type == TYPE_LOAS); assert(p_sys->i_type == TYPE_LOAS);
/* Copy the whole frame into the buffer and parse/extract it */
block_GetBytes(&p_sys->bytestream, p_buf, p_sys->i_frame_size);
p_out_buffer->i_buffer = LOASParse(p_dec, p_buf, p_sys->i_frame_size); p_out_buffer->i_buffer = LOASParse(p_dec, p_buf, p_sys->i_frame_size);
if (p_out_buffer->i_buffer <= 0) { if (p_out_buffer->i_buffer <= 0) {
if (!p_sys->b_latm_cfg) if (!p_sys->b_latm_cfg)
...@@ -1052,7 +1043,6 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block) ...@@ -1052,7 +1043,6 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block)
return p_out_buffer; return p_out_buffer;
} }
}
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment