summaryrefslogtreecommitdiffstats
path: root/xacodec.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-23 12:02:45 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-23 12:02:45 +0000
commit0ec7285e2636149f1891a079c66ca7715d6f2bf6 (patch)
treee55a21e1ea24140a04424827e0d41afaee07ce71 /xacodec.c
parent2c4c72959daf97d974d1238a60a28dc6abd8556f (diff)
downloadmpv-0ec7285e2636149f1891a079c66ca7715d6f2bf6.tar.bz2
mpv-0ec7285e2636149f1891a079c66ca7715d6f2bf6.tar.xz
some cosmetic and debugging changes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2415 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'xacodec.c')
-rw-r--r--xacodec.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/xacodec.c b/xacodec.c
index dbad936a7c..d5d1cbf921 100644
--- a/xacodec.c
+++ b/xacodec.c
@@ -148,7 +148,8 @@ int xacodec_init(char *filename, xacodec_driver_t *codec_driver)
if (mod_hdr->api_rev > XAVID_API_REV)
{
- mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported api revision in %s\n", filename);
+ mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported api revision (%d) in %s\n",
+ mod_hdr->api_rev, filename);
dlclose(codec_driver->file_handler);
return(0);
}
@@ -222,7 +223,11 @@ int xacodec_init_video(sh_video_t *vidinfo, int out_format)
xacodec_driver = realloc(xacodec_driver, sizeof(struct xacodec_driver));
if (xacodec_driver == NULL)
+ {
+ mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: memory allocation error: %s\n",
+ strerror(errno));
return(0);
+ }
xacodec_driver->iq_func = NULL;
xacodec_driver->dec_func = NULL;
@@ -297,6 +302,12 @@ int xacodec_init_video(sh_video_t *vidinfo, int out_format)
// free(codec_hdr.anim_hdr);
xacodec_driver->decinfo = malloc(sizeof(XA_DEC_INFO));
+ if (xacodec_driver->decinfo == NULL)
+ {
+ mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: memory allocation error: %s\n",
+ strerror(errno));
+ return(0);
+ }
xacodec_driver->decinfo->cmd = 0;
xacodec_driver->decinfo->skip_flag = 0;
xacodec_driver->decinfo->imagex = xacodec_driver->decinfo->xe = codec_hdr.x;
@@ -308,24 +319,24 @@ int xacodec_init_video(sh_video_t *vidinfo, int out_format)
xacodec_driver->decinfo->xs = xacodec_driver->decinfo->ys = 0;
xacodec_driver->decinfo->special = 0;
xacodec_driver->decinfo->extra = codec_hdr.extra;
+ mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "decinfo->extra, filled by codec: 0x%08x [%s]\n",
+ &xacodec_driver->decinfo->extra, xacodec_driver->decinfo->extra);
// vidinfo->our_out_buffer = malloc(codec_hdr.y * codec_hdr.x * ((codec_hdr.depth+7)/8));
// vidinfo->our_out_buffer = malloc(codec_hdr.y * codec_hdr.x * codec_hdr.depth);
- xacodec_driver->image.out_fmt=out_format;
- xacodec_driver->image.bpp=codec_hdr.depth;
- xacodec_driver->image.width=codec_hdr.x;
- xacodec_driver->image.height=codec_hdr.y;
- xacodec_driver->image.mem=malloc(codec_hdr.y * codec_hdr.x * ((codec_hdr.depth+7)/8));
+ xacodec_driver->image.out_fmt = out_format;
+ xacodec_driver->image.bpp = codec_hdr.depth;
+ xacodec_driver->image.width = codec_hdr.x;
+ xacodec_driver->image.height = codec_hdr.y;
+ xacodec_driver->image.mem = malloc(codec_hdr.y * codec_hdr.x * ((codec_hdr.depth+7)/8));
if (xacodec_driver->image.mem == NULL)
{
- mp_msg(MSGT_DECVIDEO, MSGL_ERR, "cannot allocate memory for output: %s",
+ mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: memory allocation error: %s\n",
strerror(errno));
return(0);
}
- mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "extra: %08x - %dx%d %dbit\n", codec_hdr.extra,
- codec_hdr.x, codec_hdr.y, codec_hdr.depth);
return(1);
}