mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01: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
|
@ -339,17 +339,12 @@ gst_disksink_chain (GstPad *pad, GstBuffer *buf)
|
||||||
if (disksink->maxfilesize > 0)
|
if (disksink->maxfilesize > 0)
|
||||||
{
|
{
|
||||||
if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize)
|
if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize)
|
||||||
|
{
|
||||||
|
if (GST_ELEMENT_IS_EVENT_AWARE(GST_ELEMENT(disksink)))
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
event = gst_event_new(GST_EVENT_NEW_MEDIA);
|
event = gst_event_new(GST_EVENT_NEW_MEDIA);
|
||||||
gst_pad_send_event(pad, event);
|
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)
|
|
||||||
{
|
|
||||||
gst_disksink_close_file(disksink);
|
|
||||||
disksink->filenum++;
|
|
||||||
if (!gst_disksink_open_file(disksink)) return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,17 +339,12 @@ gst_disksink_chain (GstPad *pad, GstBuffer *buf)
|
||||||
if (disksink->maxfilesize > 0)
|
if (disksink->maxfilesize > 0)
|
||||||
{
|
{
|
||||||
if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize)
|
if ((disksink->data_written + GST_BUFFER_SIZE(buf))/(1024*1024) > disksink->maxfilesize)
|
||||||
|
{
|
||||||
|
if (GST_ELEMENT_IS_EVENT_AWARE(GST_ELEMENT(disksink)))
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
event = gst_event_new(GST_EVENT_NEW_MEDIA);
|
event = gst_event_new(GST_EVENT_NEW_MEDIA);
|
||||||
gst_pad_send_event(pad, event);
|
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)
|
|
||||||
{
|
|
||||||
gst_disksink_close_file(disksink);
|
|
||||||
disksink->filenum++;
|
|
||||||
if (!gst_disksink_open_file(disksink)) return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue