From fe4128b60ee70f1aaa3f17080690cae46b020013 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 27 May 2004 11:10:11 +0000 Subject: - fix avi->compressor not being set correctly (lack of parenthesis) - workaround decoding bug (green blocks) for the xvid stream "test.avi" (i know, i know. it is a pretty generic name but some people know what i meant) - some lprintf's to real demuxer. helps debugging reference problems. CVS patchset: 6599 CVS date: 2004/05/27 11:10:11 --- src/demuxers/demux_avi.c | 15 +++++++++++++-- src/demuxers/demux_real.c | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 6610d8fca..93d88c263 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_avi.c,v 1.201 2004/05/16 18:01:27 tmattern Exp $ + * $Id: demux_avi.c,v 1.202 2004/05/27 11:10:11 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -879,7 +879,7 @@ static avi_t *AVI_init(demux_avi_t *this) { hdrl_data[i], hdrl_data[i+1], hdrl_data[i+2], hdrl_data[i+3]); if(strncasecmp(hdrl_data + i, "vids", 4) == 0 && !vids_strh_seen) { - AVI->compressor = *(uint32_t *) hdrl_data + i + 4; + AVI->compressor = *(uint32_t *) (hdrl_data + i + 4); AVI->dwInitialFrames = LE_32(hdrl_data + i + 16); AVI->dwScale = LE_32(hdrl_data + i + 20); AVI->dwRate = LE_32(hdrl_data + i + 24); @@ -1880,6 +1880,17 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) { (int)this->avi->audio[i]->wavex->wFormatTag); } + /* + * I don't know who should we trust more, if avi->compressor or bih->biCompression. + * however, at least for this case (compressor: xvid biCompression: DIVX), the + * xvid fourcc must prevail as it is used by ffmpeg to detect encoder bugs. [MF] + */ + if( _x_fourcc_to_buf_video(this->avi->compressor) == BUF_VIDEO_XVID && + _x_fourcc_to_buf_video(this->avi->bih->biCompression) == BUF_VIDEO_MPEG4 ) { + this->avi->bih->biCompression = this->avi->compressor; + this->avi->video_type = BUF_VIDEO_XVID; + } + _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 1); _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, !this->no_audio); diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 45e10c41d..438ce33ba 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -31,7 +31,7 @@ * * Based on FFmpeg's libav/rm.c. * - * $Id: demux_real.c,v 1.98 2004/05/23 16:05:47 jstembridge Exp $ + * $Id: demux_real.c,v 1.99 2004/05/27 11:10:13 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -785,6 +785,8 @@ static int demux_real_parse_references( demux_real_t *this) { xine_event_t uevent; + lprintf("parsing references\n"); + /* read file to memory. * warning: dumb code, but hopefuly ok since reference file is small */ do { @@ -803,6 +805,8 @@ static int demux_real_parse_references( demux_real_t *this) { if(buf_used) buf[buf_used] = '\0'; + + lprintf("received %d bytes [%s]\n", buf_used, buf); for(i=0;istream; -- cgit v1.2.3