[easytag] Do not warn about ID3v2 tags when saving Ogg files
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Do not warn about ID3v2 tags when saving Ogg files
- Date: Fri, 7 Nov 2014 08:37:27 +0000 (UTC)
commit 9d1e4dc1bba908fcf4cb99b136aa0184d16be699
Author: David King <amigadave amigadave com>
Date: Thu Nov 6 22:08:52 2014 +0000
Do not warn about ID3v2 tags when saving Ogg files
The Ogg tag writing code can handle ID3v2 tags without problems, and a
warning is already logged when reading the file, so warning again when
saving is not helpful.
src/tags/ogg_tag.c | 86 ----------------------------------------------------
1 files changed, 0 insertions(+), 86 deletions(-)
---
diff --git a/src/tags/ogg_tag.c b/src/tags/ogg_tag.c
index 2d8feb8..24b6ed0 100644
--- a/src/tags/ogg_tag.c
+++ b/src/tags/ogg_tag.c
@@ -815,9 +815,7 @@ ogg_tag_write_file_tag (const ET_File *ETFile,
{
const File_Tag *FileTag;
const gchar *filename;
- const gchar *filename_utf8;
GFile *file;
- GFileInputStream *istream;
vcedit_state *state;
vorbis_comment *vc;
gchar *string;
@@ -829,86 +827,8 @@ ogg_tag_write_file_tag (const ET_File *ETFile,
FileTag = (File_Tag *)ETFile->FileTag->data;
filename = ((File_Name *)ETFile->FileNameCur->data)->value;
- filename_utf8 = ((File_Name *)ETFile->FileNameCur->data)->value_utf8;
file = g_file_new_for_path (filename);
- istream = g_file_read (file, NULL, error);
-
- if (!istream)
- {
- g_object_unref (file);
- return FALSE;
- }
-
- {
- // Skip the id3v2 tag
- gsize bytes_read;
- guchar tmp_id3[4];
- gulong id3v2size;
-
- // Check if there is an ID3v2 tag...
- if (!g_seekable_seek (G_SEEKABLE (istream), 0L, G_SEEK_SET, NULL, error))
- {
- goto err;
- }
-
- if (g_input_stream_read_all (G_INPUT_STREAM (istream), tmp_id3, 4,
- &bytes_read, NULL, error))
- {
- // Calculate ID3v2 length
- if (tmp_id3[0] == 'I' && tmp_id3[1] == 'D' && tmp_id3[2] == '3' && tmp_id3[3] < 0xFF)
- {
- // id3v2 tag skipeer $49 44 33 yy yy xx zz zz zz zz [zz size]
- /* Size is 6-9 position */
- if (!g_seekable_seek (G_SEEKABLE (istream), 2, G_SEEK_CUR,
- NULL, error))
- {
- goto err;
- }
-
- if (g_input_stream_read_all (G_INPUT_STREAM (istream), tmp_id3, 4,
- &bytes_read, NULL, error))
- {
- id3v2size = 10 + ( (long)(tmp_id3[3]) | ((long)(tmp_id3[2]) << 7)
- | ((long)(tmp_id3[1]) << 14) | ((long)(tmp_id3[0]) << 21) );
-
- if (!g_seekable_seek (G_SEEKABLE (istream), id3v2size,
- G_SEEK_SET, NULL, error))
- {
- goto err;
- }
-
- Log_Print (LOG_ERROR,
- _("The Ogg Vorbis file ā%sā contains an ID3v2 tag"),
- filename_utf8);
- }
- else
- {
- g_debug ("Only %" G_GSIZE_FORMAT " bytes out of 4 bytes of "
- "data were read", bytes_read);
- goto err;
- }
-
- }
- else if (!g_seekable_seek (G_SEEKABLE (istream), 0L, G_SEEK_SET,
- NULL, error))
- {
- goto err;
- }
-
- }
- else
- {
- g_debug ("Only %" G_GSIZE_FORMAT " bytes out of 4 bytes of data were "
- "read", bytes_read);
- goto err;
- }
-
- }
-
- g_assert (error == NULL || *error == NULL);
-
- g_object_unref (istream);
state = vcedit_new_state(); // Allocate memory for 'state'
@@ -1174,11 +1094,5 @@ ogg_tag_write_file_tag (const ET_File *ETFile,
g_assert (error == NULL || *error == NULL);
return TRUE;
-
-err:
- g_assert (error == NULL || *error != NULL);
- g_object_unref (istream);
- g_object_unref (file);
- return FALSE;
}
#endif /* ENABLE_OGG */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]