diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-08-09 16:38:53 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-08-09 16:38:53 +0000 |
commit | c793316e380247738c26ce611a418eebed7eb21b (patch) | |
tree | 869779c296427425c8b839049b15df03ce0f6966 /gst/multipart/multipartdemux.c | |
parent | ec928a3d330b74fbf804e7c51985fce647dee2ce (diff) |
cleanups, debugging and memleak fixes
Original commit message from CVS:
cleanups, debugging and memleak fixes
Diffstat (limited to 'gst/multipart/multipartdemux.c')
-rw-r--r-- | gst/multipart/multipartdemux.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gst/multipart/multipartdemux.c b/gst/multipart/multipartdemux.c index 1aa3b3bc..55fe85ef 100644 --- a/gst/multipart/multipartdemux.c +++ b/gst/multipart/multipartdemux.c @@ -165,7 +165,6 @@ gst_multipart_demux_init (GstMultipartDemux * multipart) GST_FLAG_SET (multipart, GST_ELEMENT_EVENT_AWARE); multipart->maxlen = 4096; - multipart->buffer = g_malloc (multipart->maxlen); multipart->parsing_mime = NULL; multipart->numpads = 0; multipart->scanpos = 0; @@ -321,9 +320,10 @@ gst_multipart_demux_chain (GstPad * pad, GstData * buffer) } // move rest downward multipart->bufsize -= multipart->scanpos; - memcpy (multipart->buffer, multipart->buffer + multipart->scanpos, + memmove (multipart->buffer, multipart->buffer + multipart->scanpos, multipart->bufsize); + g_free (multipart->parsing_mime); multipart->parsing_mime = mime_type; multipart->scanpos = 0; } @@ -344,10 +344,20 @@ gst_multipart_demux_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: + break; case GST_STATE_READY_TO_PAUSED: + multipart->buffer = g_malloc (multipart->maxlen); + break; case GST_STATE_PAUSED_TO_PLAYING: + break; case GST_STATE_PLAYING_TO_PAUSED: + break; case GST_STATE_PAUSED_TO_READY: + g_free (multipart->parsing_mime); + multipart->parsing_mime = NULL; + g_free (multipart->buffer); + multipart->buffer = NULL; + break; case GST_STATE_READY_TO_NULL: break; default: |