summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-04-29 18:43:18 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-04-29 18:43:18 +0000
commitb540fe5ab90d052249fdfebd9365a7429dd2a7a1 (patch)
tree958eb500f2713b2817e6774c62c46e163bb3755a /src
parent12018188e9317c2092a3e12db8672b25b1e4bbad (diff)
downloadxine-lib-b540fe5ab90d052249fdfebd9365a7429dd2a7a1.tar.gz
xine-lib-b540fe5ab90d052249fdfebd9365a7429dd2a7a1.tar.bz2
lpcm support to mpeg_demux.c. i have no sample to test it, may
somebody please check if it works? CVS patchset: 4709 CVS date: 2003/04/29 18:43:18
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_mpeg.c30
-rw-r--r--src/demuxers/demux_mpeg_block.c8
2 files changed, 31 insertions, 7 deletions
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index 107f11438..842248e34 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.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.c,v 1.115 2003/04/27 11:56:13 guenter Exp $
+ * $Id: demux_mpeg.c,v 1.116 2003/04/29 18:43:18 miguelfreitas Exp $
*
* demultiplexer for mpeg 1/2 program streams
* reads streams of variable blocksizes
@@ -282,7 +282,9 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
}
i = this->input->read (this->input, this->dummy_space, 1);
+ track = this->dummy_space[0] & 0x0F ;
+ /* DVD spu/subtitles */
if((this->dummy_space[0] & 0xE0) == 0x20) {
buf = this->input->read_block (this->input, this->video_fifo, header_len+len-1);
@@ -300,12 +302,32 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
return;
}
- /* read rest of header */
+ /* LPCM audio */
+ if((this->dummy_space[0] & 0xf0) == 0xa0) {
+ i = this->input->read (this->input, this->dummy_space+1, 6);
+
+ buf = this->input->read_block (this->input, this->video_fifo, header_len+len-7);
+
+ buf->type = BUF_AUDIO_LPCM_BE + track;
+ buf->decoder_flags |= BUF_FLAG_SPECIAL;
+ buf->decoder_info[1] = BUF_SPECIAL_LPCM_CONFIG;
+ buf->decoder_info[2] = this->dummy_space[5];
+ buf->pts = pts;
+
+ check_newpts( this, pts, PTS_AUDIO );
+
+ if(this->audio_fifo)
+ this->audio_fifo->put (this->audio_fifo, buf);
+ else
+ buf->free_buffer(buf);
+
+ return;
+ }
+
+ /* read rest of header - assume AC3 */
i = this->input->read (this->input, this->dummy_space+1, header_len+3);
- track = this->dummy_space[0] & 0x0F ;
/* contents */
-
for (i = len - 4; i > 0; i -= (this->audio_fifo)
? this->audio_fifo->buffer_pool_buf_size : this->video_fifo->buffer_pool_buf_size) {
if(this->audio_fifo) {
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index d1f768fc4..0795ef11f 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.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_block.c,v 1.173 2003/04/26 20:16:13 guenter Exp $
+ * $Id: demux_mpeg_block.c,v 1.174 2003/04/29 18:43:20 miguelfreitas Exp $
*
* demultiplexer for mpeg 1/2 program streams
*
@@ -527,9 +527,10 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
buf->size = packet_len-1;
buf->type = BUF_SPU_SVCD + spu_id;
buf->pts = pts;
+ /* this is probably wrong:
if( !preview_mode )
check_newpts( this, pts, PTS_VIDEO );
-
+ */
this->video_fifo->put (this->video_fifo, buf);
#ifdef LOG
printf ("demux_mpeg_block: SPU SVCD PACK (%lld, %d) put on fifo\n", pts, spu_id);
@@ -546,9 +547,10 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
buf->size = packet_len-1;
buf->type = BUF_SPU_CVD + spu_id;
buf->pts = pts;
+ /* this is probably wrong:
if( !preview_mode )
check_newpts( this, pts, PTS_VIDEO );
-
+ */
this->video_fifo->put (this->video_fifo, buf);
#ifdef LOG
printf ("demux_mpeg_block: SPU CVD PACK (%lld, %d) put on fifo\n", pts, spu_id);