diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/combined/xine_vorbis_decoder.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/combined/xine_vorbis_decoder.c b/src/combined/xine_vorbis_decoder.c index bdbeca0a6..8fd9fc88a 100644 --- a/src/combined/xine_vorbis_decoder.c +++ b/src/combined/xine_vorbis_decoder.c @@ -159,6 +159,34 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen; + /* Disassemble a regular decoder configuration packet. + Calm down, there is only 1 level of recursion ;-) */ + if ((buf->decoder_flags & BUF_FLAG_SPECIAL) && (buf->decoder_info[1] == BUF_SPECIAL_DECODER_CONFIG)) { + uint8_t *head = buf->decoder_info_ptr[2], *data, *olddata = buf->content; + int len = buf->decoder_info[2], part, i, oldsize = buf->size, oldflags = buf->decoder_flags; + if (!head || (--len < 0)) + return; + i = *head++; + if ((len -= i) < 0) + return; + data = head + i; + buf->decoder_flags = BUF_FLAG_HEADER | BUF_FLAG_FRAME_END; + for (; i >= 0; i--) { + part = i ? *head++ : len; + if (part > len) + part = len; + buf->content = data; + buf->size = part; + vorbis_decode_data (this_gen, buf); + data += part; + len -= part; + } + buf->decoder_flags = oldflags; + buf->content = olddata; + buf->size = oldsize; + return; + } + memset( &this->op, 0, sizeof(this->op) ); /* data accumulation */ |