[easytag] Check before flushing ogg stream in vcedit_write
- From: Abhinav Jangda <abhijangda src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Check before flushing ogg stream in vcedit_write
- Date: Thu, 20 Mar 2014 07:30:32 +0000 (UTC)
commit 030db34a07aeca90bde7807b2c2eceaee8cfd72a
Author: Abhinav <abhijangda hotmail com>
Date: Thu Mar 20 12:59:30 2014 +0530
Check before flushing ogg stream in vcedit_write
src/vcedit.c | 39 +++++++++++++++++++++------------------
1 files changed, 21 insertions(+), 18 deletions(-)
---
diff --git a/src/vcedit.c b/src/vcedit.c
index a208204..b407257 100644
--- a/src/vcedit.c
+++ b/src/vcedit.c
@@ -561,26 +561,29 @@ vcedit_write(vcedit_state *state, GFile *file, GError **error)
{
if(needflush)
{
- gsize bytes_written;
-
- if (!g_output_stream_write_all (ostream, ogout.header,
- ogout.header_len, &bytes_written,
- NULL, error))
+ if (ogg_stream_flush (&streamout, &ogout))
{
- g_debug ("Only %" G_GSIZE_FORMAT " bytes out of %ld bytes of "
- "data were written", bytes_written, ogout.header_len);
- g_assert (error == NULL || *error != NULL);
- goto cleanup;
- }
+ gsize bytes_written;
- if (!g_output_stream_write_all (ostream, ogout.body,
- ogout.body_len, &bytes_written,
- NULL, error))
- {
- g_debug ("Only %" G_GSIZE_FORMAT " bytes out of %ld bytes of "
- "data were written", bytes_written, ogout.body_len);
- g_assert (error == NULL || *error != NULL);
- goto cleanup;
+ if (!g_output_stream_write_all (ostream, ogout.header,
+ ogout.header_len, &bytes_written,
+ NULL, error))
+ {
+ g_debug ("Only %" G_GSIZE_FORMAT " bytes out of %ld bytes of "
+ "data were written", bytes_written, ogout.header_len);
+ g_assert (error == NULL || *error != NULL);
+ goto cleanup;
+ }
+
+ if (!g_output_stream_write_all (ostream, ogout.body,
+ ogout.body_len, &bytes_written,
+ NULL, error))
+ {
+ g_debug ("Only %" G_GSIZE_FORMAT " bytes out of %ld bytes of "
+ "data were written", bytes_written, ogout.body_len);
+ g_assert (error == NULL || *error != NULL);
+ goto cleanup;
+ }
}
}
else if(needout)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]