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.
+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
2005-10-12 Andy Wingo <wingo@pobox.com>
* gst/gst.c (gst_init_check): Ignore unknown options, as has
GST_DEBUG_OBJECT (filesink, "Seeking to offset %" G_GUINT64_FORMAT,
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,
#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;
- if (fseek (filesink->file, (long) new_offset, SEEK_SET) == 0)
- return;
+ if (fseek (filesink->file, (long) new_offset, SEEK_SET) != 0)
+ goto seek_failed;
- 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) */
}
/* handle events (search) */
GST_DEBUG_OBJECT (filesink, "Seeking to offset %" G_GUINT64_FORMAT,
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,
#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;
- if (fseek (filesink->file, (long) new_offset, SEEK_SET) == 0)
- return;
+ if (fseek (filesink->file, (long) new_offset, SEEK_SET) != 0)
+ goto seek_failed;
- 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) */
}
/* handle events (search) */