summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_ac3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_ac3.c')
-rw-r--r--src/demuxers/demux_ac3.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c
index c0fae275b..711bb0b45 100644
--- a/src/demuxers/demux_ac3.c
+++ b/src/demuxers/demux_ac3.c
@@ -37,6 +37,9 @@
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
#define LOG_MODULE "demux_ac3"
#define LOG_VERBOSE
@@ -308,13 +311,7 @@ static int demux_ac3_send_chunk (demux_plugin_t *this_gen) {
this->frame_size);
}
- if (buf->size == 0) {
- buf->free_buffer(buf);
- this->status = DEMUX_FINISHED;
- return this->status;
- }
-
- if (buf->size == 0) {
+ if (buf->size <= 0) {
buf->free_buffer(buf);
this->status = DEMUX_FINISHED;
return this->status;
@@ -417,7 +414,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_ac3_t *this;
- this = xine_xmalloc (sizeof (demux_ac3_t));
+ this = calloc(1, sizeof(demux_ac3_t));
this->stream = stream;
this->input = input;
@@ -491,7 +488,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_ac3_init_plugin (xine_t *xine, void *data) {
demux_ac3_class_t *this;
- this = xine_xmalloc (sizeof (demux_ac3_class_t));
+ this = calloc(1, sizeof(demux_ac3_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;