diff options
author | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2004-05-16 21:35:16 +0000 |
---|---|---|
committer | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2004-05-16 21:35:16 +0000 |
commit | 7428411695fc7915a71e1e7396207b1f9b1a4c63 (patch) | |
tree | ac5a3c9183f84168c6b117e84ef7e57416d49f34 /src | |
parent | 4ed7d86315c1b69cef3c11ed0adf4c52771986d6 (diff) | |
download | xine-lib-7428411695fc7915a71e1e7396207b1f9b1a4c63.tar.gz xine-lib-7428411695fc7915a71e1e7396207b1f9b1a4c63.tar.bz2 |
From: Reinhard Nissl
1) the 'size' of the A52 frame was calculated 'result' bytes to small.
2) a simpler "not jumbo detection": if 'size' was not changed, then it's not a jumbo and we're done.
CVS patchset: 6555
CVS date: 2004/05/16 21:35:16
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_mpeg_pes.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c index 6a2518b18..757e33394 100644 --- a/src/demuxers/demux_mpeg_pes.c +++ b/src/demuxers/demux_mpeg_pes.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpeg_pes.c,v 1.23 2004/05/16 18:01:43 tmattern Exp $ + * $Id: demux_mpeg_pes.c,v 1.24 2004/05/16 21:35:16 jcdutton Exp $ * * demultiplexer for mpeg 2 PES (Packetized Elementary Streams) * reads streams of variable blocksizes @@ -897,8 +897,8 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el buf->decoder_info[2] = 0; /* First access unit pointer */ buf->content = p; - size = this->packet_len - result; - if ((size+result) > (buf->max_size) ) { + size = this->packet_len; + if ((size + result) > buf->max_size) { size = buf->max_size - result; } buf->size = size; @@ -913,17 +913,19 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el } else { buf->free_buffer(buf); } - if (this->packet_len <= (buf->max_size - 6)) { + if (size == this->packet_len) { return this->packet_len + result; - } + } + /* Handle Jumbo A52 frames from VDR. */ offset = size; while (offset < this->packet_len) { int i; buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); size = this->packet_len - offset; - if (size > (buf->max_size)) size = buf->max_size; - offset+=size; + if (size > buf->max_size) + size = buf->max_size; + offset += size; i = this->input->read (this->input, buf->mem, (off_t) (size)); if (i != size) { buf->free_buffer(buf); @@ -944,7 +946,6 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el return this->packet_len + result; } - |