diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2002-02-03 15:47:02 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2002-02-03 15:47:02 +0000 |
commit | 41d83ad803eb02149bfe6071bf535d3b492831ef (patch) | |
tree | 9f391fe6cf0ad87731b745c4cffa885fb9c4ba94 /gst | |
parent | 63c5bedc40676868608ae0a8415c4f8a71a3677b (diff) |
Some small adjustments for for better open-a-new-file handling
Original commit message from CVS:
Some small adjustments for for better open-a-new-file handling
Diffstat (limited to 'gst')
-rw-r--r-- | gst/avi/gstavimux.c | 8 | ||||
-rw-r--r-- | gst/avi/gstavimux.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index 12f13c6c..fdb7ca6f 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -797,6 +797,7 @@ gst_avimux_start_file (GstAviMux *avimux) gst_pad_push(avimux->srcpad, header); avimux->write_header = FALSE; + avimux->restart = FALSE; } static void @@ -843,7 +844,7 @@ gst_avimux_restart_file (GstAviMux *avimux) gst_avimux_stop_file(avimux); event = gst_event_new(GST_EVENT_NEW_MEDIA); - gst_pad_push(avimux->srcpad, GST_BUFFER(event)); + gst_pad_send_event(avimux->srcpad, event); /*gst_avimux_start_file(avimux);*/ } @@ -861,7 +862,7 @@ gst_avimux_handle_event (GstPad *pad, GstEvent *event) switch (type) { case GST_EVENT_NEW_MEDIA: - gst_avimux_restart_file(avimux); + avimux->restart = TRUE; break; default: break; @@ -914,6 +915,9 @@ gst_avimux_chain (GstPad *pad, GstBuffer *buf) } else if (strncmp(padname, "video_", 6) == 0) { + if (avimux->restart) + gst_avimux_restart_file(avimux); + /* write a video header + index entry */ GST_BUFFER_SIZE(buf) = (GST_BUFFER_SIZE(buf)+3)&~3; diff --git a/gst/avi/gstavimux.h b/gst/avi/gstavimux.h index c03ae7eb..ebf801e0 100644 --- a/gst/avi/gstavimux.h +++ b/gst/avi/gstavimux.h @@ -71,6 +71,7 @@ struct _GstAviMux { guint32 num_frames, numx_frames; /* num frames in the AVI/AVIX block */ guint32 header_size; gboolean write_header; + gboolean restart; guint32 audio_size; /* video header */ |