The attached patch should allow to compile with previous version of
libflac 1.1.3
Regards,
Jerome
Emilio Scalise wrote, the 15/12/2007 22:16 :
Please note that I'm using a backport. Later I'll try with lenny/sid
on my other pc.
Easytag 2.1.4 doesn't compile against libflac 1.1.2 (the etch
version), so I'm using also a libflac backport. But this is another
issue, I'll send another bugreport.
diff -ruN easytag-2.1.4.orig/src/easytag.c easytag-2.1.4/src/easytag.c
--- easytag-2.1.4.orig/src/easytag.c 2007-12-06 22:59:38.000000000 +0100
+++ easytag-2.1.4/src/easytag.c 2007-12-10 23:33:08.000000000 +0100
@@ -3971,6 +3971,15 @@
#endif
#ifdef ENABLE_FLAC
+ /* Patch from Josh Coalson
+ * FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 *
+ * by LEGACY_FLAC we mean pre-FLAC 1.1.3; in FLAC 1.1.3 the
FLAC__FileDecoder was merged into the FLAC__StreamDecoder */
+ #if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
+ #define LEGACY_FLAC // For FLAC version < 1.1.3
+ #else
+ #undef LEGACY_FLAC
+ #endif
+
case FLAC_TAG:
gtk_widget_show(GTK_WIDGET(DiscNumberLabel));
gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
@@ -3990,9 +3999,10 @@
gtk_widget_show(GTK_WIDGET(EncodedByLabel));
gtk_widget_show(GTK_WIDGET(EncodedByEntry));
gtk_widget_show(GTK_WIDGET(EncodedByMButton));
- // Picture always supported now...
- /*if (WRITE_ID3_TAGS_IN_FLAC_FILE)
- {*/
+ // Picture supported for FLAC >= 1.1.3...
+ #ifdef LEGACY_FLAC
+ if (WRITE_ID3_TAGS_IN_FLAC_FILE)
+ {
gtk_widget_show(GTK_WIDGET(PictureLabel));
gtk_widget_show(GTK_WIDGET(PictureScrollWindow));
gtk_widget_show(GTK_WIDGET(PictureMButton));
@@ -4000,7 +4010,7 @@
gtk_widget_show(GTK_WIDGET(PictureAddButton));
gtk_widget_show(GTK_WIDGET(PictureSaveButton));
gtk_widget_show(GTK_WIDGET(PicturePropertiesButton));
- /*}else
+ }else
{
gtk_widget_hide(GTK_WIDGET(PictureLabel));
gtk_widget_hide(GTK_WIDGET(PictureScrollWindow));
@@ -4009,7 +4019,16 @@
gtk_widget_hide(GTK_WIDGET(PictureAddButton));
gtk_widget_hide(GTK_WIDGET(PictureSaveButton));
gtk_widget_hide(GTK_WIDGET(PicturePropertiesButton));
- }*/
+ }
+ #else
+ gtk_widget_show(GTK_WIDGET(PictureLabel));
+ gtk_widget_show(GTK_WIDGET(PictureScrollWindow));
+ gtk_widget_show(GTK_WIDGET(PictureMButton));
+ gtk_widget_show(GTK_WIDGET(PictureClearButton));
+ gtk_widget_show(GTK_WIDGET(PictureAddButton));
+ gtk_widget_show(GTK_WIDGET(PictureSaveButton));
+ gtk_widget_show(GTK_WIDGET(PicturePropertiesButton));
+ #endif
break;
#endif
diff -ruN easytag-2.1.4.orig/src/flac_tag.c easytag-2.1.4/src/flac_tag.c
--- easytag-2.1.4.orig/src/flac_tag.c 2007-12-09 17:52:23.000000000 +0100
+++ easytag-2.1.4/src/flac_tag.c 2007-12-10 23:24:27.000000000 +0100
@@ -105,7 +105,9 @@
FLAC__Metadata_SimpleIterator *iter;
gchar *string = NULL;
guint i;
+#ifndef LEGACY_FLAC // For FLAC >= 1.1.3
Picture *prev_pic = NULL;
+#endif
//gint j = 1;
@@ -615,43 +617,41 @@
//
// Read the PICTURE block (severals can exist)
//
+#ifndef LEGACY_FLAC // For FLAC >= 1.1.3
case FLAC__METADATA_TYPE_PICTURE:
{
/***********
* Picture *
***********/
- // For FLAC >= 1.1.3
- #ifndef LEGACY_FLAC
- FLAC__StreamMetadata_Picture *p;
- Picture *pic;
-
- // Get picture data from block
- p = &block->data.picture;
-
- pic = Picture_Allocate();
- if (!prev_pic)
- FileTag->picture = pic;
- else
- prev_pic->next = pic;
- prev_pic = pic;
-
- pic->size = p->data_length;
- pic->data = g_memdup(p->data,pic->size);
- pic->type = p->type;
- pic->description = g_strdup((gchar *)p->description);
- // Not necessary: will be calculated later
- //pic->height = p->height;
- //pic->width = p->width;
+ FLAC__StreamMetadata_Picture *p;
+ Picture *pic;
+
+ // Get picture data from block
+ p = &block->data.picture;
+
+ pic = Picture_Allocate();
+ if (!prev_pic)
+ FileTag->picture = pic;
+ else
+ prev_pic->next = pic;
+ prev_pic = pic;
+
+ pic->size = p->data_length;
+ pic->data = g_memdup(p->data,pic->size);
+ pic->type = p->type;
+ pic->description = g_strdup((gchar *)p->description);
+ // Not necessary: will be calculated later
+ //pic->height = p->height;
+ //pic->width = p->width;
- //g_print("Picture type :
%s\n",FLAC__StreamMetadata_Picture_TypeString[p->type]);
- //g_print("Mime type : %s\n",p->mime_type);
+ //g_print("Picture type :
%s\n",FLAC__StreamMetadata_Picture_TypeString[p->type]);
+ //g_print("Mime type : %s\n",p->mime_type);
- #endif
-
break;
}
-
+#endif
+
default:
break;
}
@@ -822,12 +822,14 @@
//
// Delete all the PICTURE blocks, and convert to padding
//
+#ifndef LEGACY_FLAC // For FLAC >= 1.1.3
case FLAC__METADATA_TYPE_PICTURE:
{
FLAC__metadata_iterator_delete_block(iter,true);
break;
}
-
+#endif
+
default:
break;
}