summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/load_plugins.c85
-rw-r--r--src/xine-engine/metronom.c14
-rw-r--r--src/xine-engine/metronom.h3
-rw-r--r--src/xine-engine/video_out.c40
-rw-r--r--src/xine-engine/xine.c64
-rw-r--r--src/xine-engine/xine_internal.h6
6 files changed, 83 insertions, 129 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 7063d7bed..ad4b1b2c8 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.69 2002/02/16 22:43:24 guenter Exp $
+ * $Id: load_plugins.c,v 1.70 2002/03/12 19:51:29 guenter Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -47,27 +47,9 @@
#include "xineutils.h"
#include "compat.h"
+/*
#define LOG
-
-#ifdef __GNUC__
-#define LOG_MSG_STDERR(xine, message, args...) { \
- xine_log(xine, XINE_LOG_PLUGIN, message, ##args); \
- fprintf(stderr, message, ##args); \
- }
-#define LOG_MSG(xine, message, args...) { \
- xine_log(xine, XINE_LOG_PLUGIN, message, ##args); \
- printf(message, ##args); \
- }
-#else
-#define LOG_MSG_STDERR(xine, ...) { \
- xine_log(xine, XINE_LOG_PLUGIN, __VA_ARGS__); \
- fprintf(stderr, __VA_ARGS__); \
- }
-#define LOG_MSG(xine, ...) { \
- xine_log(xine, XINE_LOG_PLUGIN, __VA_ARGS__); \
- printf(__VA_ARGS__); \
- }
-#endif
+*/
/* transition code; between xine 0.9.7 and 0.9.8, the dxr3enc driver
* was integrated in the dxr3 driver and no longer exists as a seperate
@@ -115,8 +97,8 @@ void load_demux_plugins (xine_t *this,
config_values_t *config, int iface_version) {
DIR *dir;
- if(this == NULL || config == NULL) {
- LOG_MSG(this, _("%s(%s@%d): parameter should be non null, exiting\n"),
+ if (this == NULL || config == NULL) {
+ printf (_("%s(%s@%d): parameter should be non null, exiting\n"),
__FILE__, __XINE_FUNCTION__, __LINE__);
exit(1);
}
@@ -153,8 +135,9 @@ void load_demux_plugins (xine_t *this,
if(!(plugin = dlopen (str, RTLD_LAZY))) {
char *dl_error_msg = dlerror();
- LOG_MSG(this, _("load_plugins: cannot open demux plugin %s:\n%s\n"),
- str, dl_error_msg);
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("load_plugins: cannot open demux plugin %s:\n%s\n"),
+ str, dl_error_msg);
} else {
@@ -167,15 +150,16 @@ void load_demux_plugins (xine_t *this,
if (dxp) {
this->demuxer_plugins[this->num_demuxer_plugins] = dxp;
- LOG_MSG(this, _("load_plugins: demux plugin found : %s\n"),
- this->demuxer_plugins[this->num_demuxer_plugins]->get_identifier());
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("load_plugins: demux plugin found : %s\n"),
+ this->demuxer_plugins[this->num_demuxer_plugins]->get_identifier());
this->num_demuxer_plugins++;
}
}
if(this->num_demuxer_plugins > DEMUXER_PLUGIN_MAX) {
- LOG_MSG(this, _("load_plugins: too many demux plugins installed, exiting.\n"));
+ printf ( _("load_plugins: too many demux plugins installed, exiting.\n"));
exit(1);
}
}
@@ -313,8 +297,9 @@ void load_input_plugins (xine_t *this,
if(!(plugin = dlopen (str, RTLD_LAZY))) {
char *dl_error_msg = dlerror();
- LOG_MSG(this, _("load_plugins: cannot open input plugin %s:\n%s\n"),
- str, dl_error_msg);
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("load_plugins: cannot open input plugin %s:\n%s\n"),
+ str, dl_error_msg);
} else {
void *(*initplug) (int, xine_t *);
@@ -325,19 +310,21 @@ void load_input_plugins (xine_t *this,
if (ip) {
this->input_plugins[this->num_input_plugins] = ip;
- LOG_MSG(this, _("load_plugins: input plugin found : %s\n"),
- this->input_plugins[this->num_input_plugins]->get_identifier(this->input_plugins[this->num_input_plugins]));
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("load_plugins: input plugin found : %s\n"),
+ this->input_plugins[this->num_input_plugins]->get_identifier(this->input_plugins[this->num_input_plugins]));
this->num_input_plugins++;
}
} else {
- LOG_MSG(this, _("load_plugins: %s is no valid input plugin (lacks init_input_plugin() function)\n"), str);
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("load_plugins: %s is no valid input plugin (lacks init_input_plugin() function)\n"), str);
}
if(this->num_input_plugins > INPUT_PLUGIN_MAX) {
- LOG_MSG_STDERR(this, _("%s(%d): too many input plugins installed, "
- "exiting.\n"), __FILE__, __LINE__);
+ printf (_("%s(%d): too many input plugins installed, "
+ "exiting.\n"), __FILE__, __LINE__);
exit(1);
}
}
@@ -349,8 +336,8 @@ void load_input_plugins (xine_t *this,
remove_segv_handler();
if (this->num_input_plugins == 0) {
- LOG_MSG_STDERR(this, _("load_plugins: no input plugins found in %s! - "
- "Did you install xine correctly??\n"), XINE_PLUGINDIR);
+ printf (_("load_plugins: no input plugins found in %s! - "
+ "Did you install xine correctly??\n"), XINE_PLUGINDIR);
exit (1);
}
@@ -468,8 +455,8 @@ void load_decoder_plugins (xine_t *this,
if(this == NULL || config == NULL) {
- LOG_MSG(this, _("%s(%s@%d): parameter should be non null, exiting\n"),
- __FILE__, __XINE_FUNCTION__, __LINE__);
+ printf ( _("%s(%s@%d): parameter should be non null, exiting\n"),
+ __FILE__, __XINE_FUNCTION__, __LINE__);
exit(1);
}
@@ -529,8 +516,9 @@ void load_decoder_plugins (xine_t *this,
if(!(plugin = dlopen (str, RTLD_LAZY))) {
char *dl_error_msg = dlerror();
- LOG_MSG(this, _("load_plugins: failed to load plugin %s:\n%s\n"),
- str, dl_error_msg);
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("load_plugins: failed to load plugin %s:\n%s\n"),
+ str, dl_error_msg);
} else {
int plugin_prio;
@@ -557,8 +545,9 @@ void load_decoder_plugins (xine_t *this,
spu_prio[streamtype] = plugin_prio;
}
- LOG_MSG(this, _("spu decoder plugin found : %s\n"),
- sdp->get_identifier());
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("spu decoder plugin found : %s\n"),
+ sdp->get_identifier());
}
}
}
@@ -585,8 +574,9 @@ void load_decoder_plugins (xine_t *this,
video_prio[streamtype] = plugin_prio;
}
- LOG_MSG(this, _("video decoder plugin found : %s\n"),
- vdp->get_identifier());
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("video decoder plugin found : %s\n"),
+ vdp->get_identifier());
}
}
@@ -609,8 +599,9 @@ void load_decoder_plugins (xine_t *this,
audio_prio[streamtype] = plugin_prio;
}
- LOG_MSG(this, _("audio decoder plugin found : %s\n"),
- adp->get_identifier());
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("audio decoder plugin found : %s\n"),
+ adp->get_identifier());
}
}
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index adfba2f77..30f8c9f65 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.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: metronom.c,v 1.67 2002/03/12 11:04:07 guenter Exp $
+ * $Id: metronom.c,v 1.68 2002/03/12 19:51:29 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -368,6 +368,9 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
} else {
this->video_drift = diff;
+ this->video_drift_step = diff / 30;
+ /* this will fix video drift with a constant compensation each
+ frame for about 1 second of video. */
#ifdef LOG
if (diff)
@@ -384,11 +387,9 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
(this->video_drift<0)?'+':'-', abs(this->video_drift) );
#endif
- /* this will fix video drift with a constant compensation each
- frame for about 1 second of video. */
- img->duration -= this->video_drift/30;
- if (this->video_drift)
- this->video_drift -= this->video_drift / 30;
+ img->duration -= this->video_drift_step;
+
+ this->video_drift -= this->video_drift_step;
if (this->video_drift<0)
this->video_drift = 0;
@@ -620,6 +621,7 @@ metronom_t * metronom_init (int have_audio, void *xine) {
this->video_vpts = PREBUFFER_PTS_OFFSET;
this->video_drift = 0;
+ this->video_drift_step = 0;
this->video_discontinuity_count = 0;
pthread_cond_init (&this->video_discontinuity_reached, NULL);
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index 5ad28dcb2..9e486a222 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -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: metronom.h,v 1.21 2002/03/11 12:31:26 guenter Exp $
+ * $Id: metronom.h,v 1.22 2002/03/12 19:51:29 guenter Exp $
*
* metronom: general pts => virtual calculation/assoc
*
@@ -212,6 +212,7 @@ struct metronom_s {
int in_discontinuity;
int64_t video_drift;
+ int64_t video_drift_step;
int64_t av_offset;
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index ee61adc8e..bc7358cc7 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2000-2002 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free video player.
*
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -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.c,v 1.78 2002/03/01 09:29:50 guenter Exp $
+ * $Id: video_out.c,v 1.79 2002/03/12 19:51:29 guenter Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -40,26 +40,6 @@
#include "xine_internal.h"
#include "xineutils.h"
-#ifdef __GNUC__
-#define LOG_MSG_STDERR(xine, message, args...) { \
- xine_log(xine, XINE_LOG_MSG, message, ##args); \
- fprintf(stderr, message, ##args); \
- }
-#define LOG_MSG(xine, message, args...) { \
- xine_log(xine, XINE_LOG_MSG, message, ##args); \
- printf(message, ##args); \
- }
-#else
-#define LOG_MSG_STDERR(xine, ...) { \
- xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \
- fprintf(stderr, __VA_ARGS__); \
- }
-#define LOG_MSG(xine, ...) { \
- xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \
- printf(__VA_ARGS__); \
- }
-#endif
-
/*
#define LOG
*/
@@ -320,10 +300,10 @@ static int vo_frame_draw (vo_frame_t *img) {
*/
if (this->num_frames_delivered>199) {
- LOG_MSG_STDERR(this->xine,
- _("%d frames delivered, %d frames skipped, %d frames discarded\n"),
- this->num_frames_delivered,
- this->num_frames_skipped, this->num_frames_discarded);
+ xine_log(this->xine, XINE_LOG_MSG,
+ _("%d frames delivered, %d frames skipped, %d frames discarded\n"),
+ this->num_frames_delivered,
+ this->num_frames_skipped, this->num_frames_discarded);
this->num_frames_delivered = 0;
this->num_frames_discarded = 0;
@@ -373,9 +353,9 @@ static void expire_frames (vos_t *this, int64_t cur_vpts) {
diff = cur_vpts - pts;
if (diff > img->duration) {
- LOG_MSG(this->xine,
- _("video_out: throwing away image with pts %lld because "
- "it's too old (diff : %lld).\n"), pts, diff);
+ xine_log(this->xine, XINE_LOG_MSG,
+ _("video_out: throwing away image with pts %lld because "
+ "it's too old (diff : %lld).\n"), pts, diff);
this->num_frames_discarded++;
@@ -1004,7 +984,7 @@ vo_instance_t *vo_new_instance (vo_driver_t *driver, xine_t *xine) {
printf (_("video_out: sorry, this should not happen. please restart xine.\n"));
exit(1);
} else
- LOG_MSG(this->xine, _("video_out: thread created\n"));
+ printf ("video_out: thread created\n");
return &this->vo;
}
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 2e0a2f527..ef88b6a31 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2000-2001 the xine project
+ * Copyright (C) 2000-2002 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free video player.
*
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -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.c,v 1.107 2002/03/11 19:58:01 jkeil Exp $
+ * $Id: xine.c,v 1.108 2002/03/12 19:51:29 guenter Exp $
*
* top-level xine functions
*
@@ -56,26 +56,6 @@
#include "xineutils.h"
#include "compat.h"
-#ifdef __GNUC__
-#define LOG_MSG_STDERR(xine, message, args...) { \
- xine_log(xine, XINE_LOG_MSG, message, ##args); \
- fprintf(stderr, message, ##args); \
- }
-#define LOG_MSG(xine, message, args...) { \
- xine_log(xine, XINE_LOG_MSG, message, ##args); \
- printf(message, ##args); \
- }
-#else
-#define LOG_MSG_STDERR(xine, ...) { \
- xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \
- fprintf(stderr, __VA_ARGS__); \
- }
-#define LOG_MSG(xine, ...) { \
- xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \
- printf(__VA_ARGS__); \
- }
-#endif
-
void * xine_notify_stream_finished_thread (void * this_gen) {
xine_t *this = this_gen;
xine_event_t event;
@@ -106,8 +86,8 @@ void xine_notify_stream_finished (xine_t *this) {
*/
if ((err = pthread_create (&finished_thread,
NULL, xine_notify_stream_finished_thread, this)) != 0) {
- LOG_MSG_STDERR(this, _("xine_notify_stream_finished: can't create new thread (%s)\n"),
- strerror(err));
+ printf (_("xine_notify_stream_finished: can't create new thread (%s)\n"),
+ strerror(err));
exit (1);
}
}
@@ -169,12 +149,12 @@ void xine_stop_internal (xine_t *this) {
pthread_mutex_lock (&this->xine_lock);
- LOG_MSG(this, _("xine_stop\n"));
+ printf ("xine_stop\n");
/* xine_internal_osd (this, "}", this->metronom->get_current_time (this->metronom), 30000); never works */
if (this->status == XINE_STOP) {
- LOG_MSG(this, _("xine_stop ignored\n"));
+ printf ("xine_stop ignored\n");
pthread_mutex_unlock (&this->xine_lock);
return;
}
@@ -185,7 +165,7 @@ void xine_stop_internal (xine_t *this) {
xine_set_speed_internal(this, SPEED_NORMAL);
this->status = XINE_STOP;
- LOG_MSG(this, _("xine_stop: stopping demuxer\n"));
+ printf ("xine_stop: stopping demuxer\n");
if(this->cur_demuxer_plugin) {
this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin);
@@ -202,7 +182,7 @@ void xine_stop_internal (xine_t *this) {
*/
}
- LOG_MSG(this, _("xine_stop: done\n"));
+ printf ("xine_stop: done\n");
pthread_mutex_unlock (&this->xine_lock);
}
@@ -233,8 +213,8 @@ static int try_demux_with_stages(xine_t *this, const char *MRL,
stages[2] = -1;
if(stages[0] == -1) {
- LOG_MSG_STDERR(this, _("%s(%d) wrong first stage = %d !!\n"),
- __XINE_FUNCTION__, __LINE__, stage1);
+ printf (_("%s(%d) wrong first stage = %d !!\n"),
+ __XINE_FUNCTION__, __LINE__, stage1);
return 0;
}
@@ -339,7 +319,8 @@ int xine_play (xine_t *this, char *mrl,
}
if (!this->cur_input_plugin) {
- LOG_MSG(this, _("xine: cannot find input plugin for this MRL\n"));
+ xine_log (this, XINE_LOG_FORMAT,
+ _("xine: cannot find input plugin for this MRL\n"));
this->cur_demuxer_plugin = NULL;
this->err = XINE_ERROR_NO_INPUT_PLUGIN;
pthread_mutex_unlock (&this->xine_lock);
@@ -360,15 +341,13 @@ int xine_play (xine_t *this, char *mrl,
*/
if (!find_demuxer(this, mrl)) {
- LOG_MSG(this, _("xine: couldn't find demuxer for >%s<\n"), mrl);
+ xine_log (this, XINE_LOG_FORMAT,
+ _("xine: couldn't find demuxer for >%s<\n"), mrl);
this->err = XINE_ERROR_NO_DEMUXER_PLUGIN;
pthread_mutex_unlock (&this->xine_lock);
return 0;
}
- printf ("xine: using demuxer plugin >%s< for this MRL.\n",
- this->cur_demuxer_plugin->get_identifier());
-
xine_log (this, XINE_LOG_FORMAT,
_("system layer format '%s' detected.\n"),
this->cur_demuxer_plugin->get_identifier());
@@ -390,7 +369,8 @@ int xine_play (xine_t *this, char *mrl,
pos, start_time);
if (this->cur_demuxer_plugin->get_status(this->cur_demuxer_plugin) != DEMUX_OK) {
- LOG_MSG(this, _("xine_play: demuxer failed to start\n"));
+ xine_log (this, XINE_LOG_MSG,
+ _("xine_play: demuxer failed to start\n"));
this->cur_input_plugin->close(this->cur_input_plugin);
@@ -437,11 +417,11 @@ void xine_exit (xine_t *this) {
xine_stop(this);
- LOG_MSG(this, _("xine_exit: shutdown audio\n"));
+ printf ("xine_exit: shutdown audio\n");
audio_decoder_shutdown (this);
- LOG_MSG(this, _("xine_exit: shutdown video\n"));
+ printf ("xine_exit: shutdown video\n");
video_decoder_shutdown (this);
@@ -449,7 +429,7 @@ void xine_exit (xine_t *this) {
this->status = XINE_QUIT;
- LOG_MSG(this, _("xine_exit: bye!\n"));
+ printf ("xine_exit: bye!\n");
for (i = 0; i < XINE_LOG_NUM; i++)
this->log_buffers[i]->dispose (this->log_buffers[i]);
@@ -614,7 +594,7 @@ int xine_get_current_position (xine_t *this) {
pthread_mutex_lock (&this->xine_lock);
if (!this->cur_input_plugin) {
- LOG_MSG(this, _("xine: xine_get_current_position: no input source\n"));
+ printf ("xine: xine_get_current_position: no input source\n");
pthread_mutex_unlock (&this->xine_lock);
return 0;
}
@@ -730,7 +710,7 @@ void xine_set_speed (xine_t *this, int speed) {
/* make sure osd can be displayed */
xine_usec_sleep(100000);
- LOG_MSG(this, _("xine: set_speed %d\n"), speed);
+ printf ("xine: set_speed %d\n", speed);
xine_set_speed_internal (this, speed);
pthread_mutex_unlock (&this->xine_lock);
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 1ce4135e2..be68a092d 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2000-2001 the xine project
+ * Copyright (C) 2000-2002 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free video player.
*
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -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_internal.h,v 1.72 2002/02/17 17:32:51 guenter Exp $
+ * $Id: xine_internal.h,v 1.73 2002/03/12 19:51:29 guenter Exp $
*
*/