diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-06-09 17:07:21 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-06-09 17:07:21 +0000 |
commit | a6286f5fc779af20613910ddf8032c25d74247ac (patch) | |
tree | 6e0a7066d4869d8f9c6e3a4f297efb7fbbf18ae5 | |
parent | e0b25d1271e1816b2b41b9af9514c3fa6bf674cf (diff) | |
download | xine-lib-a6286f5fc779af20613910ddf8032c25d74247ac.tar.gz xine-lib-a6286f5fc779af20613910ddf8032c25d74247ac.tar.bz2 |
more avi demuxer/libw32 bugfixes
CVS patchset: 136
CVS date: 2001/06/09 17:07:21
-rw-r--r-- | src/demuxers/demux_avi.c | 39 | ||||
-rw-r--r-- | src/libac3/xine_decoder.c | 5 | ||||
-rw-r--r-- | src/libmpg123/xine_decoder.c | 8 | ||||
-rw-r--r-- | src/libw32dll/Makefile.am | 12 | ||||
-rw-r--r-- | src/libw32dll/w32codec.c | 27 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 4 | ||||
-rw-r--r-- | src/xine-engine/audio_decoder.c | 10 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 14 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 7 |
9 files changed, 94 insertions, 32 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index ad74125ef..4ec644c8b 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.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_avi.c,v 1.15 2001/06/07 20:23:54 guenter Exp $ + * $Id: demux_avi.c,v 1.16 2001/06/09 17:07:21 guenter Exp $ * * demultiplexer for avi streams * @@ -656,7 +656,10 @@ static long AVI_read_audio(demux_avi_t *this, avi_t *AVI, char *audbuf, } left = AVI->audio_index[AVI->audio_posc].len - AVI->audio_posb; - *bFrameDone = (left==0)+1; + if (left==0) + *bFrameDone = 2; + else + *bFrameDone = 1; return nr; } @@ -703,7 +706,10 @@ static long AVI_read_video(demux_avi_t *this, avi_t *AVI, char *vidbuf, } left = AVI->video_index[AVI->video_posf].len - AVI->video_posb; - *bFrameDone = (left==0)+1; + if (left==0) + *bFrameDone = 2; + else + *bFrameDone = 1; return nr; } @@ -783,6 +789,12 @@ static int demux_avi_next (demux_avi_t *this) { return 0; } + /* + printf ("demux_avi: adding buf %d to video fifo, decoder_info[0]: %d\n", + buf, buf->decoder_info[0]); + */ + + this->video_fifo->put (this->video_fifo, buf); } @@ -913,7 +925,26 @@ static void demux_avi_start (demux_plugin_t *this_gen, memcpy (buf->content, &this->avi->wavex, sizeof (this->avi->wavex)); buf->size = sizeof (this->avi->wavex); - buf->type = BUF_AUDIO_AVI; + switch (this->avi->a_fmt) { + case 0x01: + buf->type = BUF_AUDIO_LPCM; + break; + case 0x2000: + buf->type = BUF_AUDIO_AC3; + break; + case 0x50: + case 0x55: + buf->type = BUF_AUDIO_MPEG; + break; + case 0x161: + buf->type = BUF_AUDIO_AVI; + break; + default: + printf ("demux_avi: unknown audio type 0x%lx =>exit\n", this->avi->a_fmt); + this->status = DEMUX_FINISHED; + buf->type = BUF_AUDIO_MPEG; + break; + } buf->decoder_info[0] = 0; /* first package, containing wavex */ this->audio_fifo->put (this->audio_fifo, buf); } diff --git a/src/libac3/xine_decoder.c b/src/libac3/xine_decoder.c index 74122c960..46ac1b8a3 100644 --- a/src/libac3/xine_decoder.c +++ b/src/libac3/xine_decoder.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: xine_decoder.c,v 1.9 2001/05/31 22:54:39 guenter Exp $ + * $Id: xine_decoder.c,v 1.10 2001/06/09 17:07:21 guenter Exp $ * * stuff needed to turn libac3 into a xine decoder plugin */ @@ -120,6 +120,9 @@ void ac3dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { uint8_t byte; + if (buf->decoder_info[0] == 0) + return; + this->pts = buf->PTS; while (current != end) { diff --git a/src/libmpg123/xine_decoder.c b/src/libmpg123/xine_decoder.c index 8508dcd24..339b2a0d6 100644 --- a/src/libmpg123/xine_decoder.c +++ b/src/libmpg123/xine_decoder.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: xine_decoder.c,v 1.1 2001/05/27 23:48:12 guenter Exp $ + * $Id: xine_decoder.c,v 1.2 2001/06/09 17:07:21 guenter Exp $ * * stuff needed to turn libmpg123 into a xine decoder plugin */ @@ -67,8 +67,10 @@ void mpgdec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { mpgdec_decoder_t *this = (mpgdec_decoder_t *) this_gen; - mpg_audio_decode_data (this->mpg, buf->content, buf->content + buf->size, - buf->PTS); + if (buf->decoder_info[0] >0) { + mpg_audio_decode_data (this->mpg, buf->content, buf->content + buf->size, + buf->PTS); + } } void mpgdec_close (audio_decoder_t *this_gen) { diff --git a/src/libw32dll/Makefile.am b/src/libw32dll/Makefile.am index 07b7f1292..c5f9d5b5f 100644 --- a/src/libw32dll/Makefile.am +++ b/src/libw32dll/Makefile.am @@ -1,10 +1,14 @@ EXTRA_DIST = stubs.s -# CFLAGS = @BUILD_LIB_STATIC@ -I wine -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf -fno-omit-frame-pointer -# CFLAGS = -I wine -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf -fno-omit-frame-pointer @X_CFLAGS@ -CFLAGS = -DXINE_COMPILE -I wine -fno-omit-frame-pointer \ - -DWIN32_PATH=\"@w32_path@\" -pipe +#CFLAGS = -DXINE_COMPILE -I wine -fno-omit-frame-pointer \ +# -DWIN32_PATH=\"@w32_path@\" -pipe + +#CFLAGS = @GLOBAL_CFLAGS@ -DWIN32_PATH=\"@w32_path@\" -I wine -fno-omit-frame-pointer\ +# -fno-inline -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf + +CFLAGS = -DWIN32_PATH=\"@w32_path@\" -I wine -fno-omit-frame-pointer\ + -DXINE_COMPILE -D__WINE__ -pipe SUBDIRS = wine diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 89f2c21c1..a9404326d 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.2 2001/06/07 20:23:54 guenter Exp $ + * $Id: w32codec.c,v 1.3 2001/06/09 17:07:21 guenter Exp $ * * routines for using w32 codecs * @@ -173,6 +173,8 @@ static void w32v_init (video_decoder_t *this_gen, vo_instance_t *video_out) { this->video_out = video_out; this->decoder_ok = 0; + + printf ("w32codec: init - video_out: %d \n",this->video_out ); } @@ -190,12 +192,16 @@ static void w32v_init_codec (w32v_decoder_t *this) { if(!this->hic){ printf ("ICOpen failed! unknown codec / wrong parameters?\n"); this->decoder_ok = 0; + return; } + printf ("w32codec: w32v_init_codec...\n"); + ret = ICDecompressGetFormat(this->hic, &this->bih, &this->o_bih); if(ret){ printf("ICDecompressGetFormat failed: Error %ld\n", (long)ret); this->decoder_ok = 0; + return; } if(outfmt==IMGFMT_YUY2) @@ -219,12 +225,14 @@ static void w32v_init_codec (w32v_decoder_t *this) { if(ret){ printf("ICDecompressQuery failed: Error %ld\n", (long)ret); this->decoder_ok = 0; + return; } ret = ICDecompressBegin(this->hic, &this->bih, &this->o_bih); if(ret){ printf("ICDecompressBegin failed: Error %ld\n", (long)ret); this->decoder_ok = 0; + return; } if (this->yuv_hack_needed) { @@ -233,10 +241,14 @@ static void w32v_init_codec (w32v_decoder_t *this) { this->size = 0; - if (!(this->video_out->get_capabilities (this->video_out) && VO_CAP_YUY2)) { + + if (!( (this->video_out->get_capabilities (this->video_out)) & VO_CAP_YUY2)) { printf ("video output driver doesn't support YUY2 !!"); this->decoder_ok = 0; } + + + printf ("w32codec: w32v_init_codec o_bih.biSizeImage : %d\n",this->o_bih.biSizeImage ); this->our_out_buffer = malloc (this->o_bih.biSizeImage); @@ -248,9 +260,13 @@ static void w32v_init_codec (w32v_decoder_t *this) { static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { w32v_decoder_t *this = (w32v_decoder_t *) this_gen; + /* + printf ("w32codec: processing packet type = %08x, buf : %d, buf->decoder_info[0]=%d\n", + buf->type, buf, buf->decoder_info[0]); + */ if (buf->decoder_info[0] == 0) { - /* init package containing bih */ + /* init package containing bih */ memcpy ( &this->bih, buf->content, sizeof (BITMAPINFOHEADER)); this->video_step = buf->decoder_info[1]; @@ -259,6 +275,8 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } else if (this->decoder_ok) { + /* printf ("w32codec: processing packet ...\n"); */ + memcpy (&this->buf[this->size], buf->content, buf->size); this->size += buf->size; @@ -296,6 +314,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { this->size = 0; } + /* printf ("w32codec: processing packet done\n"); */ } } @@ -315,6 +334,7 @@ static char *w32v_get_id(void) { */ static int w32a_can_handle (audio_decoder_t *this_gen, int buf_type) { + return ((buf_type & 0xFFFF0000) == BUF_AUDIO_AVI) ; } @@ -494,7 +514,6 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { /* init package containing bih */ this->decoder_ok = w32a_init_audio (this, (WAVEFORMATEX *)buf->content); - } else if (this->decoder_ok) { w32a_decode_audio (this, buf->content, buf->size, diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 23bc5b311..086b4644c 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.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: video_out_xv.c,v 1.35 2001/06/04 17:13:36 guenter Exp $ + * $Id: video_out_xv.c,v 1.36 2001/06/09 17:07:21 guenter Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -134,6 +134,8 @@ static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; + printf ("video_out_xv: get capabilities\n"); + return this->capabilities; } diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 764683574..b4b4fdae2 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.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: audio_decoder.c,v 1.14 2001/06/04 17:01:47 f1rmb Exp $ + * $Id: audio_decoder.c,v 1.15 2001/06/09 17:07:22 guenter Exp $ * * * functions that implement audio decoding @@ -103,7 +103,7 @@ void *audio_decoder_loop (void *this_gen) { default: if ( (buf->type & 0xFF000000) == BUF_AUDIO_BASE ) { - /* printf ("audio_decoder: got an audio buffer, type %08x\n", buf->type); */ + /* printf ("audio_decoder: got an audio buffer, type %08x\n", buf->type); */ /* update track map */ @@ -127,8 +127,7 @@ void *audio_decoder_loop (void *this_gen) { this->audio_track_map_entries++; if (i<=this->audio_channel) { - /* printf ("audio_decoder: resetting audio decoder because of new channel\n"); */ - + /* close old audio decoder */ if (this->cur_audio_decoder_plugin) { this->cur_audio_decoder_plugin->close (this->cur_audio_decoder_plugin); this->cur_audio_decoder_plugin = NULL; @@ -143,9 +142,6 @@ void *audio_decoder_loop (void *this_gen) { int streamtype = (buf->type>>16) & 0xFF; - /* printf ("audio_decoder_c: buffer is from the right track => decode it\n"); */ - - decoder = this->audio_decoder_plugins [streamtype]; if (decoder) { diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 67ab4a2bc..028e19860 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.20 2001/06/07 20:23:54 guenter Exp $ + * $Id: load_plugins.c,v 1.21 2001/06/09 17:07:22 guenter Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -406,11 +406,11 @@ void load_decoder_plugins (xine_t *this, sprintf (str, "%s/%s", XINE_PLUGINDIR, pEntry->d_name); if(!(plugin = dlopen (str, RTLD_LAZY))) { - fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n", - __FILE__, __LINE__, str, dlerror()); - exit(1); - } - else { + + printf ("load_plugins: failed to load plugin %s:\n%s\n", + str, dlerror()); + + } else { void *(*initplug) (int, config_values_t *); /* @@ -459,7 +459,7 @@ void load_decoder_plugins (xine_t *this, } } } - + this->cur_video_decoder_plugin = NULL; this->cur_audio_decoder_plugin = NULL; } diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index bbe5214b6..270d2717b 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.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: video_decoder.c,v 1.19 2001/06/04 17:13:36 guenter Exp $ + * $Id: video_decoder.c,v 1.20 2001/06/09 17:07:22 guenter Exp $ * */ @@ -68,6 +68,11 @@ void *video_decoder_loop (void *this_gen) { case BUF_VIDEO_MPEG: case BUF_VIDEO_AVI: + /* + printf ("video_decoder: got package %d, decoder_info[0]:%d\n", + buf, buf->decoder_info[0]); + */ + streamtype = (buf->type>>16) & 0xFF; decoder = this->video_decoder_plugins [streamtype]; |