1
0
mirror of http://mpg123.de/trunk/.git synced 2025-10-25 04:37:34 +03:00

Some things relating to ID3v2 handling:

- the named entries for artist, album, etc in struct mpg123_id3v2 are now pointers...
	- ... into the new arrays of ID3v2 text, comment and extra (TXXX) data
	- That makes a lot more info directly accessible; which id3dump now does access
	- adapted id3print.c to the pointer thing (by dropping some & ;-)
	- mpg123_copy_string() now produces an empty string (_not_ "") when copying from NULL

id3.c got a bit of structure, but the main parsing function is still to bloated.
In general, I hope this change of ID3v2 handling makes sense.
You have more data plus the possibility to easily loop through the entries...



git-svn-id: svn://scm.orgis.org/mpg123/trunk@1205 35dc7657-300d-0410-a2e5-dc2837fedb53
This commit is contained in:
thor
2007-12-01 21:42:44 +00:00
parent 57fe26c8e9
commit 56ed6fb018
7 changed files with 255 additions and 136 deletions

View File

@@ -53,14 +53,25 @@ int mpg123_resize_string(mpg123_string* sb, size_t new)
int mpg123_copy_string(mpg123_string* from, mpg123_string* to)
{
size_t fill;
char *text;
if(to == NULL) return -1;
if(from == NULL) return mpg123_set_string(to, "");
if(mpg123_resize_string(to, from->fill))
if(from == NULL)
{
memcpy(to->p, from->p, to->size);
to->fill = to->size;
fill = 0;
text = NULL;
}
else
{
fill = from->fill;
text = from->p;
}
if(mpg123_resize_string(to, fill))
{
memcpy(to->p, text, fill);
to->fill = fill;
return 1;
}
else return 0;