From fe318ef2cb9e7eab4a6a74768af50f74e97f3e7e Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Fri, 2 May 2003 20:48:35 +0000 Subject: re-revert mpeg demuxer changes (mpeg x mpeg_block) CVS patchset: 4753 CVS date: 2003/05/02 20:48:35 --- src/demuxers/demux_mpeg.c | 63 +++++++++-------------------------------- src/demuxers/demux_mpeg_block.c | 5 ++-- 2 files changed, 15 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 842248e34..b7ecc60ee 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -17,12 +17,11 @@ * 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.116 2003/04/29 18:43:18 miguelfreitas Exp $ + * $Id: demux_mpeg.c,v 1.117 2003/05/02 20:48:35 miguelfreitas Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes * - * currently only used for mpeg-1-files * */ @@ -1025,40 +1024,18 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str input->seek(input, 0, SEEK_SET); if (input->read(input, buf, 16) == 16) { - if(!buf[0] && !buf[1] && (buf[2] == 0x01)) { - - switch(buf[3]) { - case 0xba: - if((buf[4] & 0xf0) == 0x20) { - uint32_t pckbuf ; + /* + * look for mpeg header + */ + + if (!buf[0] && !buf[1] && (buf[2] == 0x01) + && (buf[3] == 0xba)) /* if so, take it */ + break; - pckbuf = read_bytes (this, 1); - if ((pckbuf>>4) != 4) { - ok = 1; - break; - } - } - break; -#if 0 - case 0xe0: - if((buf[6] & 0xc0) != 0x80) { - uint32_t pckbuf ; - - pckbuf = read_bytes (this, 1); - if ((pckbuf>>4) != 4) { - ok = 1; - break; - } - } - break; -#endif - } - } + free (this); + return NULL; } - if (ok) - break; - /* special case for MPEG streams hidden inside QT files; check * is there is an mdat atom */ find_mdat_atom(input, &mdat_atom_offset, &mdat_atom_size); @@ -1073,24 +1050,10 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str /* go through the same MPEG detection song and dance */ if (input->read(input, buf, 6)) { - if (!buf[0] && !buf[1] && buf[2] == 0x01) { - switch (buf[3]) { - case 0xba: - if ((buf[4] & 0xf0) == 0x20) { - uint32_t pckbuf ; - - pckbuf = read_bytes (this, 1); - if ((pckbuf>>4) != 4) { - ok = 1; - } - } - break; - } - } - } - - if (ok) + if (!buf[0] && !buf[1] && (buf[2] == 0x01) + && (buf[3] == 0xba)) /* if so, take it */ break; + } free (this); return NULL; diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 0795ef11f..f197b4421 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -17,9 +17,10 @@ * 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.174 2003/04/29 18:43:20 miguelfreitas Exp $ + * $Id: demux_mpeg_block.c,v 1.175 2003/05/02 20:48:35 miguelfreitas Exp $ * * demultiplexer for mpeg 1/2 program streams + * used with fixed blocksize devices (like dvd/vcd) * */ @@ -1119,14 +1120,12 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str case METHOD_BY_CONTENT: { -#if 0 /* use demux_mpeg_block for vob files (performance reasons) */ /* use demux_mpeg for non-block devices */ if (!(input->get_capabilities(input) & INPUT_CAP_BLOCK)) { free (this->scratch_base); free (this); return NULL; } -#endif if (((input->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) ) { -- cgit v1.2.3