summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_pes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_pes.c')
-rw-r--r--src/demuxers/demux_pes.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/src/demuxers/demux_pes.c b/src/demuxers/demux_pes.c
index 88065aa0a..d65f10fd3 100644
--- a/src/demuxers/demux_pes.c
+++ b/src/demuxers/demux_pes.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_pes.c,v 1.15 2001/11/30 00:53:51 f1rmb Exp $
+ * $Id: demux_pes.c,v 1.16 2001/12/27 14:30:30 f1rmb Exp $
*
* demultiplexer for mpeg 2 PES (Packetized Elementary Streams)
* reads streams of variable blocksizes
@@ -46,10 +46,32 @@
#define VALID_MRLS "fifo,stdin"
#define VALID_ENDS "vdr"
+#ifdef __GNUC__
+#define LOG_MSG_STDERR(xine, message, args...) { \
+ xine_log(xine, XINE_LOG_DEMUX, message, ##args); \
+ fprintf(stderr, message, ##args); \
+ }
+#define LOG_MSG(xine, message, args...) { \
+ xine_log(xine, XINE_LOG_DEMUX, message, ##args); \
+ printf(message, ##args); \
+ }
+#else
+#define LOG_MSG_STDERR(xine, ...) { \
+ xine_log(xine, XINE_LOG_DEMUX, __VAR_ARGS__); \
+ fprintf(stderr, __VA_ARGS__); \
+ }
+#define LOG_MSG(xine, ...) { \
+ xine_log(xine, XINE_LOG_DEMUX, __VAR_ARGS__); \
+ printf(__VA_ARGS__); \
+ }
+#endif
+
typedef struct demux_pes_s {
demux_plugin_t demux_plugin;
+ xine_t *xine;
+
config_values_t *config;
fifo_buffer_t *audio_fifo;
@@ -100,9 +122,8 @@ static uint32_t read_bytes (demux_pes_t *this, int n) {
res = (buf[2]<<8) | buf[3] | (buf[1]<<16) | (buf[0] << 24);
break;
default:
- fprintf (stderr,
- "How how - something wrong in wonderland demux:read_bytes (%d)\n",
- n);
+ LOG_MSG_STDERR(this->xine,
+ _("How how - something wrong in wonderland demux:read_bytes (%d)\n"), n);
exit (1);
}
@@ -325,7 +346,7 @@ static void *demux_pes_loop (void *this_gen) {
}
}
- printf ("demux loop finished (status: %d, buf:%x)\n",
+ LOG_MSG(this->xine, _("demux loop finished (status: %d, buf:%x)\n"),
this->status, w);
pthread_exit(NULL);
@@ -339,7 +360,7 @@ static void demux_pes_stop (demux_plugin_t *this_gen) {
buf_element_t *buf;
void *p;
- printf ("demux_pes: stop...\n");
+ LOG_MSG(this->xine, _("demux_pes: stop...\n"));
if (this->status != DEMUX_OK) {
@@ -435,8 +456,8 @@ static void demux_pes_start (demux_plugin_t *this_gen,
if ((err = pthread_create (&this->thread,
NULL, demux_pes_loop, this)) != 0) {
- fprintf (stderr, "demux_pes: can't create new thread (%s)\n",
- strerror(err));
+ LOG_MSG_STDERR(this->xine, _("demux_pes: can't create new thread (%s)\n"),
+ strerror(err));
exit (1);
}
}
@@ -565,15 +586,17 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) {
demux_pes_t *this;
if (iface != 6) {
- printf( "demux_pes: plugin doesn't support plugin API version %d.\n"
- "demux_pes: this means there's a version mismatch between xine and this "
- "demux_pes: demuxer plugin.\nInstalling current demux plugins should help.\n",
+ LOG_MSG(xine,
+ _("demux_pes: plugin doesn't support plugin API version %d.\n"
+ " this means there's a version mismatch between xine and this "
+ " demuxer plugin.\nInstalling current demux plugins should help.\n"),
iface);
return NULL;
}
this = xine_xmalloc (sizeof (demux_pes_t));
this->config = xine->config;
+ this->xine = xine;
(void*) this->config->register_string(this->config, "mrl.mrls_pes", VALID_MRLS,
"valid mrls for pes demuxer",