summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2003-04-06 22:56:16 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2003-04-06 22:56:16 +0000
commite53e7d10665f18720746034eca7a2b8daf2a98b9 (patch)
tree17a95400d6227ab6a730381bb161b479d9b3eb60
parentea9ae4923bc169fd74b32aa090fd60b684fbd09a (diff)
downloadxine-lib-e53e7d10665f18720746034eca7a2b8daf2a98b9.tar.gz
xine-lib-e53e7d10665f18720746034eca7a2b8daf2a98b9.tar.bz2
fix XINE_EVENT_UI_MESSAGE - no pointers in message data please, as this piece of event data will be copied (flat)
CVS patchset: 4555 CVS date: 2003/04/06 22:56:16
-rw-r--r--include/xine.h.in19
-rw-r--r--src/xine-engine/xine_interface.c17
2 files changed, 18 insertions, 18 deletions
diff --git a/include/xine.h.in b/include/xine.h.in
index cedf68c29..8c3afedc9 100644
--- a/include/xine.h.in
+++ b/include/xine.h.in
@@ -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.h.in,v 1.72 2003/04/06 15:50:57 holstsn Exp $
+ * $Id: xine.h.in,v 1.73 2003/04/06 22:56:16 guenter Exp $
*
* public xine-lib (libxine) interface and documentation
*
@@ -1277,17 +1277,16 @@ typedef struct {
/* See XINE_MSG_xxx for defined types. */
int type;
- /* defined types are provided with a standard explanation.
- * note: explanation may be NULL.
- */
- char *explanation;
-
- /* parameters are zero terminated strings */
+ /* some message types have additional information parameters */
int num_parameters;
- char *parameters;
- /* where messages are stored, will be longer */
- char internal_data[1];
+ /* where messages are stored, will be longer
+ *
+ * this field begins with the message text itself (\0-terminated),
+ * followed by (optional) \0-terminated parameter strings
+ * the end marker is \0 \0
+ */
+ char messages[1];
} xine_ui_message_data_t;
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index d9b6ee0c2..e075001d4 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.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_interface.c,v 1.48 2003/04/04 19:20:53 miguelfreitas Exp $
+ * $Id: xine_interface.c,v 1.49 2003/04/06 22:56:17 guenter Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -741,20 +741,18 @@ int xine_message(xine_stream_t *stream, int type, ...) {
}
va_end(ap);
- size += sizeof(xine_ui_message_data_t);
+ size += sizeof(xine_ui_message_data_t) + 1;
data = xine_xmalloc( size );
strcpy(data->compatibility.str,
"Upgrade your frontend to see the error messages");
data->type = type;
data->num_parameters = n;
+ params = data->messages;
+
if( explanation ) {
- strcpy(data->internal_data, explanation);
- data->explanation = data->internal_data;
- params = data->parameters = data->internal_data + strlen(explanation) + 1;
- } else {
- data->explanation = NULL;
- params = data->parameters = data->internal_data;
+ strcpy (data->messages, explanation);
+ params = data->messages + strlen(explanation) + 1;
}
params[0] = '\0';
@@ -765,11 +763,14 @@ int xine_message(xine_stream_t *stream, int type, ...) {
}
va_end(ap);
+ params[0] = '\0';
+
event.type = XINE_EVENT_UI_MESSAGE;
event.stream = stream;
event.data_length = size;
event.data = data;
xine_event_send(stream, &event);
+
free(data);
return 1;