diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-17 01:59:48 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-17 01:59:48 +0000 |
commit | 50ce564235215b90890b81fcdcf10603df898fd6 (patch) | |
tree | fca6b1fb22e05a9f821ba8540594169a1bca9787 | |
parent | 0bb6f834ae95cd434110ab1612563994112d75ac (diff) | |
download | xine-lib-50ce564235215b90890b81fcdcf10603df898fd6.tar.gz xine-lib-50ce564235215b90890b81fcdcf10603df898fd6.tar.bz2 |
made libmpeg2 a bit more permissive on mpeg constraints
CVS patchset: 289
CVS date: 2001/07/17 01:59:48
-rw-r--r-- | src/libmpeg2/decode.c | 5 | ||||
-rw-r--r-- | src/libmpeg2/header.c | 9 | ||||
-rw-r--r-- | src/libmpeg2/xine_decoder.c | 21 |
3 files changed, 27 insertions, 8 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 9e2a5b2f6..0cbcff334 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -171,9 +171,8 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, case 0xb3: /* sequence_header_code */ if (header_process_sequence_header (picture, buffer)) { fprintf (stderr, "bad sequence header\n"); - exit (1); - } - if (mpeg2dec->is_sequence_needed + /* exit (1); */ + } else if (mpeg2dec->is_sequence_needed || (picture->frame_width != picture->coded_picture_width) || (picture->frame_height != picture->coded_picture_height)) { diff --git a/src/libmpeg2/header.c b/src/libmpeg2/header.c index 9c4a8c694..cc2bf4022 100644 --- a/src/libmpeg2/header.c +++ b/src/libmpeg2/header.c @@ -77,16 +77,19 @@ int header_process_sequence_header (picture_t * picture, uint8_t * buffer) int width, height; int i; - if ((buffer[6] & 0x20) != 0x20) + if ((buffer[6] & 0x20) != 0x20) { return 1; /* missing marker_bit */ + } height = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2]; width = ((height >> 12) + 15) & ~15; height = ((height & 0xfff) + 15) & ~15; - if ((width > 768) || (height > 576)) - return 1; /* size restrictions for MP@ML or MPEG1 */ + if ((width > 768) || (height > 576)) { + /* printf ("%d x %d\n", width, height); */ + /*return 1;*/ /* size restrictions for MP@ML or MPEG1 */ + } picture->coded_picture_width = width; picture->coded_picture_height = height; diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c index 3f9d8ef4d..c259d9cdd 100644 --- a/src/libmpeg2/xine_decoder.c +++ b/src/libmpeg2/xine_decoder.c @@ -17,13 +17,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.10 2001/07/11 22:42:47 guenter Exp $ + * $Id: xine_decoder.c,v 1.11 2001/07/17 01:59:48 guenter Exp $ * * stuff needed to turn libmpeg2 into a xine decoder plugin */ #include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> #include "video_out.h" #include "mpeg2.h" @@ -36,6 +40,7 @@ typedef struct mpeg2dec_decoder_s { video_decoder_t video_decoder; mpeg2dec_t mpeg2; vo_instance_t *video_out; + /*int mpeg_file;*/ /* debugging purposes only */ } mpeg2dec_decoder_t; static int mpeg2dec_can_handle (video_decoder_t *this_gen, int buf_type) { @@ -50,6 +55,9 @@ static void mpeg2dec_init (video_decoder_t *this_gen, vo_instance_t *video_out) mpeg2_init (&this->mpeg2, video_out); video_out->open(video_out); this->video_out = video_out; + + /* debugging purposes */ + /*this->mpeg_file = open ("/tmp/video.mpv",O_CREAT | O_WRONLY | O_TRUNC, 0644);*/ } static void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { @@ -59,9 +67,12 @@ static void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) mpeg2_find_sequence_header (&this->mpeg2, buf->content, buf->content + buf->size); } else { + /* debugging purposes */ + /* write (this->mpeg_file, buf->content, buf->size); */ + mpeg2_decode_data (&this->mpeg2, buf->content, buf->content + buf->size, buf->PTS); - + } } @@ -73,6 +84,12 @@ static void mpeg2dec_close (video_decoder_t *this_gen) { mpeg2_close (&this->mpeg2); this->video_out->close(this->video_out); + + /* debugging purposes */ + /* + close (this->mpeg_file); + this->mpeg_file = -1; + */ } static char *mpeg2dec_get_id(void) { |