mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 06:58:49 +00:00
plugins/elements/gstfilesink.c: Be a bit smarter when seeking, like, don't try to do a seek when it's not needed. Thi...
Original commit message from CVS: * plugins/elements/gstfilesink.c: (gst_file_sink_event): Be a bit smarter when seeking, like, don't try to do a seek when it's not needed. This avoids errors when the file is not seekable. Fixes #499771.
This commit is contained in:
parent
bb523ea0a3
commit
7797419321
2 changed files with 22 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-11-27 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
|
* plugins/elements/gstfilesink.c: (gst_file_sink_event):
|
||||||
|
Be a bit smarter when seeking, like, don't try to do a seek when it's
|
||||||
|
not needed. This avoids errors when the file is not seekable.
|
||||||
|
Fixes #499771.
|
||||||
|
|
||||||
2007-11-26 Stefan Kost <ensonic@users.sf.net>
|
2007-11-26 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* docs/gst/gstreamer-docs.sgml:
|
* docs/gst/gstreamer-docs.sgml:
|
||||||
|
|
|
@ -384,6 +384,9 @@ gst_file_sink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
&stop, &pos);
|
&stop, &pos);
|
||||||
|
|
||||||
if (format == GST_FORMAT_BYTES) {
|
if (format == GST_FORMAT_BYTES) {
|
||||||
|
/* only try to seek and fail when we are going to a different
|
||||||
|
* position */
|
||||||
|
if (filesink->current_pos != start) {
|
||||||
/* FIXME, the seek should be performed on the pos field, start/stop are
|
/* FIXME, the seek should be performed on the pos field, start/stop are
|
||||||
* just boundaries for valid bytes offsets. We should also fill the file
|
* just boundaries for valid bytes offsets. We should also fill the file
|
||||||
* with zeroes if the new position extends the current EOF (sparse streams
|
* with zeroes if the new position extends the current EOF (sparse streams
|
||||||
|
@ -391,8 +394,12 @@ gst_file_sink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
if (!gst_file_sink_do_seek (filesink, (guint64) start))
|
if (!gst_file_sink_do_seek (filesink, (guint64) start))
|
||||||
goto seek_failed;
|
goto seek_failed;
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG ("Ignored NEWSEGMENT event of format %u (%s)",
|
GST_DEBUG_OBJECT (filesink, "Ignored NEWSEGMENT, no seek needed");
|
||||||
(guint) format, gst_format_get_name (format));
|
}
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (filesink,
|
||||||
|
"Ignored NEWSEGMENT event of format %u (%s)", (guint) format,
|
||||||
|
gst_format_get_name (format));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue