summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-08-10 17:37:50 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-08-10 17:37:50 +0000
commitf86d8e69cb6655f42575055862d6a9d5c4f6d2e5 (patch)
tree142ff685cc5b29407574b3cb8cd8685a2424ee39
parent9cdb6c61b02aced10c14ecf71193bd17c01c2d7a (diff)
downloadxine-lib-f86d8e69cb6655f42575055862d6a9d5c4f6d2e5.tar.gz
xine-lib-f86d8e69cb6655f42575055862d6a9d5c4f6d2e5.tar.bz2
minor bugfixes, make debug should work now, codec close hopefully works too
CVS patchset: 405 CVS date: 2001/08/10 17:37:50
-rw-r--r--src/libffmpeg/Makefile.am4
-rw-r--r--src/libffmpeg/libavcodec/Makefile.am6
-rw-r--r--src/libffmpeg/libavcodec/dsputil.c2
-rw-r--r--src/libffmpeg/libavcodec/dsputil_mmx.c3
-rw-r--r--src/libffmpeg/libavcodec/dsputil_mmx_avg.h5
-rw-r--r--src/libffmpeg/libavcodec/h263dec.c10
-rw-r--r--src/libffmpeg/libavcodec/mpeg12.c6
-rw-r--r--src/libffmpeg/libavcodec/msmpeg4.c8
-rw-r--r--src/libffmpeg/libavcodec/rv10.c20
-rw-r--r--src/libffmpeg/xine_decoder.c10
10 files changed, 43 insertions, 31 deletions
diff --git a/src/libffmpeg/Makefile.am b/src/libffmpeg/Makefile.am
index 28086e79f..6a64a0383 100644
--- a/src/libffmpeg/Makefile.am
+++ b/src/libffmpeg/Makefile.am
@@ -4,7 +4,7 @@
SUBDIRS = libavcodec
-CFLAGS = @GLOBAL_CFLAGS@
+CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 -Wall -DXINE_COMPILE
LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic
@@ -21,7 +21,7 @@ xineplug_decode_ff_la_LDFLAGS = \
noinst_HEADERS = config.h
debug:
- $(MAKE) CFLAGS="-Wall -DDEBUG -g -DXINE_COMPILE"
+ @$(MAKE) CFLAGS="-D_FILE_OFFSET_BITS=64 -Wall -DDEBUG -O -finline-functions -g -DXINE_COMPILE -DCONFIG_DECODERS -DHAVE_AV_CONFIG_H"
install-debug: debug
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
diff --git a/src/libffmpeg/libavcodec/Makefile.am b/src/libffmpeg/libavcodec/Makefile.am
index c9a19f498..799be3e53 100644
--- a/src/libffmpeg/libavcodec/Makefile.am
+++ b/src/libffmpeg/libavcodec/Makefile.am
@@ -2,7 +2,9 @@
## Process this file with automake to produce Makefile.in
##
-CFLAGS = @GLOBAL_CFLAGS@ -DCONFIG_DECODERS -DHAVE_AV_CONFIG_H
+#CFLAGS = -D_FILE_OFFSET_BITS=64 @GLOBAL_CFLAGS@ -DCONFIG_DECODERS -DHAVE_AV_CONFIG_H
+
+CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 -Wall -DXINE_COMPILE -DCONFIG_DECODERS -DHAVE_AV_CONFIG_H
LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic
@@ -25,7 +27,7 @@ noinst_HEADERS = avcodec.h dsputil.h mpegvideo.h dsputil_mmx_avg.h\
mpeg12data.h
debug:
- $(MAKE) CFLAGS="-Wall -DDEBUG -O -finline-functions -g -DXINE_COMPILE"
+ @$(MAKE) CFLAGS="-D_FILE_OFFSET_BITS=64 -Wall -DDEBUG -O -finline-functions -g -DXINE_COMPILE -DCONFIG_DECODERS -DHAVE_AV_CONFIG_H"
install-debug: debug
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
diff --git a/src/libffmpeg/libavcodec/dsputil.c b/src/libffmpeg/libavcodec/dsputil.c
index b4c06b820..96072db67 100644
--- a/src/libffmpeg/libavcodec/dsputil.c
+++ b/src/libffmpeg/libavcodec/dsputil.c
@@ -447,8 +447,10 @@ void dsputil_init(void)
block_permute(default_intra_matrix);
block_permute(default_non_intra_matrix);
+#ifndef DEBUG
#ifdef HAVE_MMX
printf ("ffmpeg: init mmx\n");
dsputil_init_mmx();
#endif
+#endif
}
diff --git a/src/libffmpeg/libavcodec/dsputil_mmx.c b/src/libffmpeg/libavcodec/dsputil_mmx.c
index 29a069566..4261259e5 100644
--- a/src/libffmpeg/libavcodec/dsputil_mmx.c
+++ b/src/libffmpeg/libavcodec/dsputil_mmx.c
@@ -22,6 +22,8 @@
#include "dsputil.h"
#include "cpu_accel.h"
+#ifndef DEBUG
+
int mm_flags; /* multimedia extension flags */
int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx, int h);
@@ -1053,3 +1055,4 @@ void dsputil_init_mmx(void)
}
}
}
+#endif /* DEBUG */
diff --git a/src/libffmpeg/libavcodec/dsputil_mmx_avg.h b/src/libffmpeg/libavcodec/dsputil_mmx_avg.h
index 5cd640f71..81b9fd482 100644
--- a/src/libffmpeg/libavcodec/dsputil_mmx_avg.h
+++ b/src/libffmpeg/libavcodec/dsputil_mmx_avg.h
@@ -19,6 +19,10 @@
* MMX optimization by Nick Kurshev <nickols_k@mail.ru>
*/
+#include "config.h"
+
+#ifndef DEBUG
+
static void DEF(put_pixels_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
{
int dh, hh;
@@ -342,3 +346,4 @@ static void DEF(sub_pixels_y2)( DCTELEM *block, const UINT8 *pixels, int line_s
} while (--h);
}
+#endif
diff --git a/src/libffmpeg/libavcodec/h263dec.c b/src/libffmpeg/libavcodec/h263dec.c
index 8bbd3a758..72a43e68f 100644
--- a/src/libffmpeg/libavcodec/h263dec.c
+++ b/src/libffmpeg/libavcodec/h263dec.c
@@ -23,8 +23,6 @@
#include "avcodec.h"
#include "mpegvideo.h"
-//#define DEBUG
-
static int h263_decode_init(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
@@ -81,7 +79,7 @@ static int h263_decode_frame(AVCodecContext *avctx,
int ret;
AVPicture *pict = data;
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
#endif
@@ -109,15 +107,15 @@ static int h263_decode_frame(AVCodecContext *avctx,
MPV_frame_start(s);
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("qscale=%d\n", s->qscale);
#endif
/* decode each macroblock */
for(s->mb_y=0; s->mb_y < s->mb_height; s->mb_y++) {
for(s->mb_x=0; s->mb_x < s->mb_width; s->mb_x++) {
-#ifdef DEBUG
- printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
+#ifdef DEBUG_PRINTS
+ printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
#endif
/* DCT & quantize */
if (s->h263_msmpeg4) {
diff --git a/src/libffmpeg/libavcodec/mpeg12.c b/src/libffmpeg/libavcodec/mpeg12.c
index 381fafadd..44fdfc0b4 100644
--- a/src/libffmpeg/libavcodec/mpeg12.c
+++ b/src/libffmpeg/libavcodec/mpeg12.c
@@ -28,9 +28,9 @@
#ifdef USE_FASTMEMCPY
#include "fastmemcpy.h"
#endif
-//#define DEBUG
+//#define DEBUG_PRINTS
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
#define dprintf(fmt,args...) printf(fmt, ## args)
#else
#define dprintf(fmt,args...)
@@ -585,7 +585,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
!s->frame_pred_frame_dct &&
(mb_type & (MB_PAT | MB_INTRA))) {
s->interlaced_dct = get_bits1(&s->gb);
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
if (s->interlaced_dct)
printf("interlaced_dct\n");
#endif
diff --git a/src/libffmpeg/libavcodec/msmpeg4.c b/src/libffmpeg/libavcodec/msmpeg4.c
index 885abc117..971ea7182 100644
--- a/src/libffmpeg/libavcodec/msmpeg4.c
+++ b/src/libffmpeg/libavcodec/msmpeg4.c
@@ -30,7 +30,7 @@
* - (encoding) select best vlc/dc table
* - (decoding) handle slice indication
*/
-//#define DEBUG
+//#define DEBUG_PRINTS
/* motion vector table */
typedef struct MVTable {
@@ -50,7 +50,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
static int msmpeg4_decode_motion(MpegEncContext * s,
int *mx_ptr, int *my_ptr);
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
int intra_count = 0;
int frame_count = 0;
#endif
@@ -197,7 +197,7 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
init_rl(&rl_table[i]);
}
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
intra_count = 0;
printf("*****frame %d:\n", frame_count++);
#endif
@@ -642,7 +642,7 @@ int msmpeg4_decode_picture_header(MpegEncContext * s)
s->mv_table_index = get_bits1(&s->gb);
s->no_rounding ^= 1;
}
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("*****frame %d:\n", frame_count++);
#endif
return 0;
diff --git a/src/libffmpeg/libavcodec/rv10.c b/src/libffmpeg/libavcodec/rv10.c
index b03cd0293..de1d4abce 100644
--- a/src/libffmpeg/libavcodec/rv10.c
+++ b/src/libffmpeg/libavcodec/rv10.c
@@ -24,8 +24,6 @@
#include "avcodec.h"
#include "mpegvideo.h"
-//#define DEBUG
-
static const UINT16 rv_lum_code[256] =
{
0x3e7f, 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06,
@@ -290,7 +288,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
pb_frame = get_bits(&s->gb, 1);
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
#endif
@@ -305,7 +303,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
s->last_dc[0] = get_bits(&s->gb, 8);
s->last_dc[1] = get_bits(&s->gb, 8);
s->last_dc[2] = get_bits(&s->gb, 8);
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("DC:%d %d %d\n",
s->last_dc[0],
s->last_dc[1],
@@ -383,7 +381,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
DCTELEM block[6][64];
AVPicture *pict = data;
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
#endif
@@ -397,7 +395,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
mb_count = rv10_decode_picture_header(s);
if (mb_count < 0) {
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("HEADER ERROR\n");
#endif
return -1;
@@ -405,7 +403,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
if (s->mb_x >= s->mb_width ||
s->mb_y >= s->mb_height) {
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("POS ERROR %d %d\n", s->mb_x, s->mb_y);
#endif
return -1;
@@ -413,7 +411,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
mb_pos = s->mb_y * s->mb_width + s->mb_x;
left = s->mb_width * s->mb_height - mb_pos;
if (mb_count > left) {
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("COUNT ERROR\n");
#endif
return -1;
@@ -423,7 +421,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
MPV_frame_start(s);
}
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("qscale=%d\n", s->qscale);
#endif
@@ -436,7 +434,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
/* decode each macroblock */
for(i=0;i<mb_count;i++) {
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
#endif
@@ -444,7 +442,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
if (h263_decode_mb(s, block) < 0) {
-#ifdef DEBUG
+#ifdef DEBUG_PRINTS
printf("ERROR\n");
#endif
return -1;
diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c
index 9d4e20747..ce208b724 100644
--- a/src/libffmpeg/xine_decoder.c
+++ b/src/libffmpeg/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.3 2001/08/08 20:48:32 guenter Exp $
+ * $Id: xine_decoder.c,v 1.4 2001/08/10 17:37:50 guenter Exp $
*
* xine decoder plugin using ffmpeg
*
@@ -280,8 +280,12 @@ static void ff_close (video_decoder_t *this_gen) {
ff_decoder_t *this = (ff_decoder_t *) this_gen;
- avcodec_close (&this->context);
- this->video_out->close(this->video_out);
+ if (this->decoder_ok) {
+ avcodec_close (&this->context);
+
+ this->video_out->close(this->video_out);
+ this->decoder_ok = 0;
+ }
}
static char *ff_get_id(void) {