mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
A discont event is the right way to handle seeking on filesink IMO
Original commit message from CVS: A discont event is the right way to handle seeking on filesink IMO
This commit is contained in:
parent
9e238148e1
commit
f50d53e209
2 changed files with 20 additions and 0 deletions
|
@ -297,6 +297,16 @@ gst_filesink_handle_event (GstPad *pad, GstEvent *event)
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case GST_EVENT_DISCONTINUOUS:
|
||||
{
|
||||
gint64 offset;
|
||||
|
||||
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &offset))
|
||||
fseek(filesink->file, offset, SEEK_SET);
|
||||
|
||||
gst_event_free (event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_NEW_MEDIA:
|
||||
/* we need to open a new file! */
|
||||
gst_filesink_close_file(filesink);
|
||||
|
|
|
@ -297,6 +297,16 @@ gst_filesink_handle_event (GstPad *pad, GstEvent *event)
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case GST_EVENT_DISCONTINUOUS:
|
||||
{
|
||||
gint64 offset;
|
||||
|
||||
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &offset))
|
||||
fseek(filesink->file, offset, SEEK_SET);
|
||||
|
||||
gst_event_free (event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_NEW_MEDIA:
|
||||
/* we need to open a new file! */
|
||||
gst_filesink_close_file(filesink);
|
||||
|
|
Loading…
Reference in a new issue