From f50d53e209f9e5aabb13ea5038a7da6f15f60460 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 8 Jun 2002 15:00:30 +0000 Subject: [PATCH] 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 --- gst/elements/gstfilesink.c | 10 ++++++++++ plugins/elements/gstfilesink.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/gst/elements/gstfilesink.c b/gst/elements/gstfilesink.c index a87e00c159..22ec0c0ca8 100644 --- a/gst/elements/gstfilesink.c +++ b/gst/elements/gstfilesink.c @@ -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); diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index a87e00c159..22ec0c0ca8 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -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);