mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
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
This commit is contained in:
parent
e9ea094528
commit
3ea3b8e8ab
2 changed files with 8 additions and 18 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue