1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

whitespace cosmetics

Originally committed as revision 9410 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2007-06-24 12:20:17 +00:00
parent 1eb1f6fdb8
commit 4bd684bc2f

View File

@ -30,7 +30,7 @@
#include "avstring.h" #include "avstring.h"
extern int extern int
vorbis_comment (AVFormatContext * as, uint8_t *buf, int size) vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
{ {
char *p = buf; char *p = buf;
int s, n, j; int s, n, j;
@ -52,7 +52,7 @@ vorbis_comment (AVFormatContext * as, uint8_t *buf, int size)
p += 4; p += 4;
size -= 4; size -= 4;
while (size >= 4){ while (size >= 4) {
char *t, *v; char *t, *v;
int tl, vl; int tl, vl;
@ -68,7 +68,7 @@ vorbis_comment (AVFormatContext * as, uint8_t *buf, int size)
size -= s; size -= s;
n--; n--;
v = memchr (t, '=', s); v = memchr(t, '=', s);
if (!v) if (!v)
continue; continue;
@ -76,30 +76,30 @@ vorbis_comment (AVFormatContext * as, uint8_t *buf, int size)
vl = s - tl - 1; vl = s - tl - 1;
v++; v++;
if (tl && vl){ if (tl && vl) {
char tt[tl + 1]; char tt[tl + 1];
char ct[vl + 1]; char ct[vl + 1];
for (j = 0; j < tl; j++) for (j = 0; j < tl; j++)
tt[j] = toupper (t[j]); tt[j] = toupper(t[j]);
tt[tl] = 0; tt[tl] = 0;
memcpy (ct, v, vl); memcpy(ct, v, vl);
ct[vl] = 0; ct[vl] = 0;
// took from Vorbis_I_spec // took from Vorbis_I_spec
if (!strcmp (tt, "AUTHOR") || !strcmp(tt, "ARTIST")) if (!strcmp(tt, "AUTHOR") || !strcmp(tt, "ARTIST"))
av_strlcpy (as->author, ct, sizeof (as->author)); av_strlcpy(as->author, ct, sizeof(as->author));
else if (!strcmp (tt, "TITLE")) else if (!strcmp(tt, "TITLE"))
av_strlcpy (as->title, ct, sizeof (as->title)); av_strlcpy(as->title, ct, sizeof(as->title));
else if (!strcmp (tt, "COPYRIGHT")) else if (!strcmp(tt, "COPYRIGHT"))
av_strlcpy (as->copyright, ct, sizeof (as->copyright)); av_strlcpy(as->copyright, ct, sizeof(as->copyright));
else if (!strcmp (tt, "DESCRIPTION")) else if (!strcmp(tt, "DESCRIPTION"))
av_strlcpy (as->comment, ct, sizeof (as->comment)); av_strlcpy(as->comment, ct, sizeof(as->comment));
else if (!strcmp (tt, "GENRE")) else if (!strcmp(tt, "GENRE"))
av_strlcpy (as->genre, ct, sizeof (as->genre)); av_strlcpy(as->genre, ct, sizeof(as->genre));
else if (!strcmp (tt, "TRACKNUMBER")) else if (!strcmp(tt, "TRACKNUMBER"))
as->track = atoi (ct); as->track = atoi(ct);
else if (!strcmp(tt, "ALBUM")) else if (!strcmp(tt, "ALBUM"))
av_strlcpy(as->album, ct, sizeof(as->album)); av_strlcpy(as->album, ct, sizeof(as->album));
else if (!strcmp(tt, "GENRE")) else if (!strcmp(tt, "GENRE"))
@ -110,10 +110,10 @@ vorbis_comment (AVFormatContext * as, uint8_t *buf, int size)
} }
if (size > 0) if (size > 0)
av_log (as, AV_LOG_INFO, "%i bytes of comment header remain\n", size); av_log(as, AV_LOG_INFO, "%i bytes of comment header remain\n", size);
if (n > 0) if (n > 0)
av_log (as, AV_LOG_INFO, av_log(as, AV_LOG_INFO,
"truncated comment header, %i comments not found\n", n); "truncated comment header, %i comments not found\n", n);
return 0; return 0;
} }
@ -152,7 +152,7 @@ fixup_vorbis_headers(AVFormatContext * as, oggvorbis_private_t *priv,
offset = 1; offset = 1;
offset += av_xiphlacing(&ptr[offset], priv->len[0]); offset += av_xiphlacing(&ptr[offset], priv->len[0]);
offset += av_xiphlacing(&ptr[offset], priv->len[1]); offset += av_xiphlacing(&ptr[offset], priv->len[1]);
for(i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
memcpy(&ptr[offset], priv->packet[i], priv->len[i]); memcpy(&ptr[offset], priv->packet[i], priv->len[i]);
offset += priv->len[i]; offset += priv->len[i];
} }
@ -172,9 +172,9 @@ vorbis_header (AVFormatContext * s, int idx)
if (os->seq > 2) if (os->seq > 2)
return 0; return 0;
if(os->seq == 0) { if (os->seq == 0) {
os->private = av_mallocz(sizeof(oggvorbis_private_t)); os->private = av_mallocz(sizeof(oggvorbis_private_t));
if(!os->private) if (!os->private)
return 0; return 0;
} }