summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-21 18:52:02 +0100
committerwm4 <wm4@nowhere>2013-12-21 20:50:13 +0100
commit9825906f73a0b1a50f0b4fb05874d9eb9bf69284 (patch)
treea99261a19f640835e13fda20e5f3442fd48c56a6
parent02a9fbd0ce01949d4767b68d49ee06ec669c0d93 (diff)
downloadmpv-9825906f73a0b1a50f0b4fb05874d9eb9bf69284.tar.bz2
mpv-9825906f73a0b1a50f0b4fb05874d9eb9bf69284.tar.xz
demux: use fprintf() for printing fatal errors
We print these before calling abort(), which is deadly unclean anyway. Avoids having to add log contexts.
-rw-r--r--demux/demux.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/demux/demux.c b/demux/demux.c
index c5cbe392af..8d46f79391 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -122,8 +122,7 @@ static void packet_destroy(void *ptr)
static struct demux_packet *create_packet(size_t len)
{
if (len > 1000000000) {
- mp_msg(MSGT_DEMUXER, MSGL_FATAL, "Attempt to allocate demux packet "
- "over 1 GB!\n");
+ fprintf(stderr, "Attempt to allocate demux packet over 1 GB!\n");
abort();
}
struct demux_packet *dp = talloc(NULL, struct demux_packet);
@@ -145,7 +144,7 @@ struct demux_packet *new_demux_packet(size_t len)
struct demux_packet *dp = create_packet(len);
dp->buffer = malloc(len + MP_INPUT_BUFFER_PADDING_SIZE);
if (!dp->buffer) {
- mp_msg(MSGT_DEMUXER, MSGL_FATAL, "Memory allocation failure!\n");
+ fprintf(stderr, "Memory allocation failure!\n");
abort();
}
memset(dp->buffer + len, 0, MP_INPUT_BUFFER_PADDING_SIZE);
@@ -171,14 +170,13 @@ struct demux_packet *new_demux_packet_from(void *data, size_t len)
void resize_demux_packet(struct demux_packet *dp, size_t len)
{
if (len > 1000000000) {
- mp_msg(MSGT_DEMUXER, MSGL_FATAL, "Attempt to realloc demux packet "
- "over 1 GB!\n");
+ fprintf(stderr, "Attempt to realloc demux packet over 1 GB!\n");
abort();
}
assert(dp->allocation);
dp->buffer = realloc(dp->buffer, len + MP_INPUT_BUFFER_PADDING_SIZE);
if (!dp->buffer) {
- mp_msg(MSGT_DEMUXER, MSGL_FATAL, "Memory allocation failure!\n");
+ fprintf(stderr, "Memory allocation failure!\n");
abort();
}
memset(dp->buffer + len, 0, MP_INPUT_BUFFER_PADDING_SIZE);