mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 05:56:31 +00:00
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.
This commit is contained in:
parent
b5fcd112ae
commit
e41e541dcc
3 changed files with 46 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
|||
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) */
|
||||
|
|
Loading…
Reference in a new issue