Commit e41e541d authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/elements/gstfilesink.c: Flush before seeking.

Original commit message from CVS:
* gst/elements/gstfilesink.c: (gst_file_sink_do_seek),
(gst_file_sink_event), (gst_file_sink_render):
Flush before seeking.
parent b5fcd112
2005-10-12 Wim Taymans <wim@fluendo.com>
* gst/elements/gstfilesink.c: (gst_file_sink_do_seek),
(gst_file_sink_event), (gst_file_sink_render):
Flush before seeking.
2005-10-12 Andy Wingo <wingo@pobox.com>
* gst/gst.c (gst_init_check): Ignore unknown options, as has
......
......@@ -305,16 +305,31 @@ gst_file_sink_do_seek (GstFileSink * filesink, guint64 new_offset)
GST_DEBUG_OBJECT (filesink, "Seeking to offset %" G_GUINT64_FORMAT,
new_offset);
if (fflush (filesink->file))
goto flush_failed;
#ifdef G_OS_UNIX
if (lseek (fileno (filesink->file), (off_t) new_offset,
SEEK_SET) != (off_t) - 1)
return;
SEEK_SET) == (off_t) - 1)
goto seek_failed;
#else
if (fseek (filesink->file, (long) new_offset, SEEK_SET) == 0)
return;
if (fseek (filesink->file, (long) new_offset, SEEK_SET) != 0)
goto seek_failed;
#endif
GST_DEBUG_OBJECT (filesink, "Seeking failed: %s", g_strerror (errno));
return;
/* ERRORS */
flush_failed:
{
GST_DEBUG_OBJECT (filesink, "Flush failed: %s", g_strerror (errno));
return;
}
seek_failed:
{
GST_DEBUG_OBJECT (filesink, "Seeking failed: %s", g_strerror (errno));
return;
}
}
/* handle events (search) */
......
......@@ -305,16 +305,31 @@ gst_file_sink_do_seek (GstFileSink * filesink, guint64 new_offset)
GST_DEBUG_OBJECT (filesink, "Seeking to offset %" G_GUINT64_FORMAT,
new_offset);
if (fflush (filesink->file))
goto flush_failed;
#ifdef G_OS_UNIX
if (lseek (fileno (filesink->file), (off_t) new_offset,
SEEK_SET) != (off_t) - 1)
return;
SEEK_SET) == (off_t) - 1)
goto seek_failed;
#else
if (fseek (filesink->file, (long) new_offset, SEEK_SET) == 0)
return;
if (fseek (filesink->file, (long) new_offset, SEEK_SET) != 0)
goto seek_failed;
#endif
GST_DEBUG_OBJECT (filesink, "Seeking failed: %s", g_strerror (errno));
return;
/* ERRORS */
flush_failed:
{
GST_DEBUG_OBJECT (filesink, "Flush failed: %s", g_strerror (errno));
return;
}
seek_failed:
{
GST_DEBUG_OBJECT (filesink, "Seeking failed: %s", g_strerror (errno));
return;
}
}
/* handle events (search) */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment