From 3ea3b8e8ab7652e3054da068b05692caa44c273b Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 3 Feb 2002 15:47:20 +0000 Subject: [PATCH] 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 --- gst/elements/gstdisksink.c | 13 ++++--------- plugins/elements/gstdisksink.c | 13 ++++--------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/gst/elements/gstdisksink.c b/gst/elements/gstdisksink.c index ad813a7..2d4e54f 100644 --- a/gst/elements/gstdisksink.c +++ b/gst/elements/gstdisksink.c @@ -340,16 +340,11 @@ gst_disksink_chain (GstPad *pad, GstBuffer *buf) { if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize) { - GstEvent *event; - event = gst_event_new(GST_EVENT_NEW_MEDIA); - gst_pad_send_event(pad, event); - - /* if the event wasn't handled, we probably need to open a new file ourselves */ - if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize) + if (GST_ELEMENT_IS_EVENT_AWARE(GST_ELEMENT(disksink))) { - gst_disksink_close_file(disksink); - disksink->filenum++; - if (!gst_disksink_open_file(disksink)) return; + GstEvent *event; + event = gst_event_new(GST_EVENT_NEW_MEDIA); + gst_pad_send_event(pad, event); } } } diff --git a/plugins/elements/gstdisksink.c b/plugins/elements/gstdisksink.c index ad813a7..2d4e54f 100644 --- a/plugins/elements/gstdisksink.c +++ b/plugins/elements/gstdisksink.c @@ -340,16 +340,11 @@ gst_disksink_chain (GstPad *pad, GstBuffer *buf) { if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize) { - GstEvent *event; - event = gst_event_new(GST_EVENT_NEW_MEDIA); - gst_pad_send_event(pad, event); - - /* if the event wasn't handled, we probably need to open a new file ourselves */ - if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize) + if (GST_ELEMENT_IS_EVENT_AWARE(GST_ELEMENT(disksink))) { - gst_disksink_close_file(disksink); - disksink->filenum++; - if (!gst_disksink_open_file(disksink)) return; + GstEvent *event; + event = gst_event_new(GST_EVENT_NEW_MEDIA); + gst_pad_send_event(pad, event); } } } -- 2.7.4