[MPlayer-cvslog] r21027 - trunk/libmpdemux/demux_nut.c
ods15
subversion at mplayerhq.hu
Sat Nov 18 16:17:50 CET 2006
Author: ods15
Date: Sat Nov 18 16:17:50 2006
New Revision: 21027
Modified:
trunk/libmpdemux/demux_nut.c
Log:
move demux_nut priv calloc to init() instead of check_file()
Modified: trunk/libmpdemux/demux_nut.c
==============================================================================
--- trunk/libmpdemux/demux_nut.c (original)
+++ trunk/libmpdemux/demux_nut.c Sat Nov 18 16:17:50 2006
@@ -48,7 +48,6 @@
static int nut_check_file(demuxer_t * demuxer) {
uint8_t buf[ID_LENGTH];
- nut_priv_t * priv = demuxer->priv = calloc(1, sizeof(nut_priv_t));
if (stream_read(demuxer->stream, buf, ID_LENGTH) != ID_LENGTH) return 0;
@@ -72,7 +71,7 @@
.read_index = index_mode,
.cache_syncpoints = 1,
};
- nut_priv_t * priv = demuxer->priv;
+ nut_priv_t * priv = demuxer->priv = calloc(1, sizeof(nut_priv_t));
nut_context_t * nut = priv->nut = nut_demuxer_init(&dopts);
nut_stream_header_t * s;
int ret;
@@ -276,6 +275,7 @@
static void demux_close_nut(demuxer_t *demuxer) {
nut_priv_t * priv = demuxer->priv;
+ if (!priv) return;
nut_demuxer_uninit(priv->nut);
free(demuxer->priv);
demuxer->priv = NULL;
More information about the MPlayer-cvslog
mailing list