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:
Wim Taymans 2002-06-08 15:00:30 +00:00
parent 9e238148e1
commit f50d53e209
2 changed files with 20 additions and 0 deletions

View file

@ -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);

View file

@ -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);