"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libmpg123/id3.c" between
mpg123-1.26.4.tar.bz2 and mpg123-1.26.5.tar.bz2

About: mpg123 is a fast console MPEG Audio Player and decoder library (MPEG 1.0/2.0/2.5, Layer 1,2 and 3 support).

id3.c  (mpg123-1.26.4.tar.bz2):id3.c  (mpg123-1.26.5.tar.bz2)
skipping to change at line 1091 skipping to change at line 1091
else fflags = 0; else fflags = 0;
if(length - tagpos < framesize) if(length - tagpos < framesize)
{ {
if(NOQUIET) error("Whoa! ID3v2 frame claims to be larger than the whole rest of the tag."); if(NOQUIET) error("Whoa! ID3v2 frame claims to be larger than the whole rest of the tag.");
break; break;
} }
tagpos += framesize; /* the impor tant advancement in whole tag */ tagpos += framesize; /* the impor tant advancement in whole tag */
/* for sanity, after full parsing tagpos should be == pos */ /* for sanity, after full parsing tagpos should be == pos */
/* debug4("ID3v2: found %s frame, size %lu (as bytes: 0x%08lx), flags 0x%016lx", id, framesize, framesize, fflags ); */ /* debug4("ID3v2: found %s frame, size %lu (as bytes: 0x%08lx), flags 0x%016lx", id, framesize, framesize, fflags ); */
/* %0abc0000 %0h00kmnp */ /* v2.4: %0abc0000 %0h00kmnp */
#define BAD_FFLAGS (unsigned long /* v2.3: %abc00000 %ijk00000 */
) 36784 /* v2.2: just zero */
#define PRES_TAG_FFLAG 16384 #define V3 (major == 3)
#define PRES_FILE_FFLAG 8192 #define BAD_FFLAGS (unsigned
#define READ_ONLY_FFLAG 4096 long) (V3 ? 7967 : 36784)
#define GROUP_FFLAG 64 #define PRES_TAG_FFLAG (unsigned
#define COMPR_FFLAG 8 long) (V3 ? 32768 : 16384)
#define ENCR_FFLAG 4 #define PRES_FILE_FFLAG (unsigned
#define UNSYNC_FFLAG 2 long) (V3 ? 16384 : 8192)
#define DATLEN_FFLAG 1 #define READ_ONLY_FFLAG (unsigned
long) (V3 ? 8192 : 4096)
#define GROUP_FFLAG (unsigned
long) (V3 ? 32 : 64)
#define COMPR_FFLAG (unsigned
long) (V3 ? 128 : 8)
#define ENCR_FFLAG (unsigned
long) (V3 ? 64 : 4)
#define UNSYNC_FFLAG (unsigned
long) (V3 ? 0 : 2)
#define DATLEN_FFLAG (unsigned
long) (V3 ? 0 : 1)
if(head_part < 4 && promote_frame name(fr, id) != 0) continue; if(head_part < 4 && promote_frame name(fr, id) != 0) continue;
/* shall not or want not handle t hese */ /* shall not or want not handle t hese */
if(fflags & (BAD_FFLAGS | COMPR_F FLAG | ENCR_FFLAG)) if(fflags & (BAD_FFLAGS | COMPR_F FLAG | ENCR_FFLAG))
{ {
if(NOQUIET) warning("ID3v 2: skipping invalid/unsupported frame"); if(NOQUIET) warning("ID3v 2: skipping invalid/unsupported frame");
continue; continue;
} }
for(i = 0; i < KNOWN_FRAMES; ++i) for(i = 0; i < KNOWN_FRAMES; ++i)
skipping to change at line 1150 skipping to change at line 1153
if(!((tag data[ipos] == 0) && (tagdata[ipos-1] == 0xff))) if(!((tag data[ipos] == 0) && (tagdata[ipos-1] == 0xff)))
{ {
r ealdata[opos++] = tagdata[ipos]; r ealdata[opos++] = tagdata[ipos];
} }
} }
realsize = opos; realsize = opos;
/* Append a zero to keep strlen() safe. */ /* Append a zero to keep strlen() safe. */
realdata[realsize ] = 0; realdata[realsize ] = 0;
debug2("ID3v2: de -unsync made %lu out of %lu bytes", realsize, framesize); debug2("ID3v2: de -unsync made %lu out of %lu bytes", realsize, framesize);
} }
// The spec says there is
a group byte, without explicitly saying that it is
// the first thing follow
ing the header. I just assume so, because of the
// ordering of the flags.
if(fflags & GROUP_FFLAG)
{ // Just skip group byte
.
if(realsize)
{
if(VERBOS
E3)
f
printf(stderr, "Note: frame of group %d\n", realdata[0]);
--realsiz
e;
++realdat
a;
} else if(NOQUIET
)
error("Gr
ouped frame without group byte, even.");
}
if(fflags & DATLEN_FFLAG)
{
// Spec says the
original (without compression or unsync) data length follows,
// so it should m
atch de-unsynced data now.
if(realsize >= 4)
{
unsigned
long datlen;
if(bytes_
to_long(realdata, datlen) && datlen == realsize-4)
{
r
ealsize -= 4;
r
ealdata += 4;
} else
{
i
f(NOQUIET)
error("frame data length bad, skipping");
r
ealsize = 0;
}
} else
{
realsize
= 0;
if(NOQUIE
T)
e
rror("frame truncated at frame data length, skipping");
}
}
pos = 0; /* now at the be ginning again... */ pos = 0; /* now at the be ginning again... */
/* Avoid reading over bou ndary, even if there is a */ /* Avoid reading over bou ndary, even if there is a */
/* zero byte of padding f or safety. */ /* zero byte of padding f or safety. */
if(realsize) switch(tt) if(realsize) switch(tt)
{ {
case comment: case comment:
case uslt: case uslt:
process_c omment(fr, tt, realdata, realsize, comment+1, id); process_c omment(fr, tt, realdata, realsize, comment+1, id);
break; break;
case extra: /* pe rhaps foobar2000's work */ case extra: /* pe rhaps foobar2000's work */
skipping to change at line 1217 skipping to change at line 1258
case picture: case picture:
if (fr->p .flags & MPG123_PICTURE) if (fr->p .flags & MPG123_PICTURE)
process_p icture(fr, realdata, realsize); process_p icture(fr, realdata, realsize);
break; break;
default: if(NOQUI ET) error1("ID3v2: unknown frame type %i", tt); default: if(NOQUI ET) error1("ID3v2: unknown frame type %i", tt);
} }
if(unsyncbuffer) if(unsyncbuffer)
free(unsyncbuffer ); free(unsyncbuffer );
} }
#undef V3
#undef BAD_FFLAGS #undef BAD_FFLAGS
#undef PRES_TAG_FFLAG #undef PRES_TAG_FFLAG
#undef PRES_FILE_FFLAG #undef PRES_FILE_FFLAG
#undef READ_ONLY_FFLAG #undef READ_ONLY_FFLAG
#undef GROUP_FFLAG #undef GROUP_FFLAG
#undef COMPR_FFLAG #undef COMPR_FFLAG
#undef ENCR_FFLAG #undef ENCR_FFLAG
#undef UNSYNC_FFLAG #undef UNSYNC_FFLAG
#undef DATLEN_FFLAG #undef DATLEN_FFLAG
} }
 End of changes. 3 change blocks. 
11 lines changed or deleted 82 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)