You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
cosmetics
Originally committed as revision 12200 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -103,10 +103,8 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
|
|||||||
double sample_rate;
|
double sample_rate;
|
||||||
unsigned int num_frames;
|
unsigned int num_frames;
|
||||||
|
|
||||||
|
|
||||||
if (size & 1)
|
if (size & 1)
|
||||||
size++;
|
size++;
|
||||||
|
|
||||||
codec->codec_type = CODEC_TYPE_AUDIO;
|
codec->codec_type = CODEC_TYPE_AUDIO;
|
||||||
codec->channels = get_be16(pb);
|
codec->channels = get_be16(pb);
|
||||||
num_frames = get_be32(pb);
|
num_frames = get_be32(pb);
|
||||||
@@ -120,11 +118,11 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
|
|||||||
/* Got an AIFF-C? */
|
/* Got an AIFF-C? */
|
||||||
if (version == AIFF_C_VERSION1) {
|
if (version == AIFF_C_VERSION1) {
|
||||||
codec->codec_tag = get_le32(pb);
|
codec->codec_tag = get_le32(pb);
|
||||||
codec->codec_id = codec_get_id (codec_aiff_tags, codec->codec_tag);
|
codec->codec_id = codec_get_id(codec_aiff_tags, codec->codec_tag);
|
||||||
|
|
||||||
switch (codec->codec_id) {
|
switch (codec->codec_id) {
|
||||||
case CODEC_ID_PCM_S16BE:
|
case CODEC_ID_PCM_S16BE:
|
||||||
codec->codec_id = aiff_codec_get_id (codec->bits_per_sample);
|
codec->codec_id = aiff_codec_get_id(codec->bits_per_sample);
|
||||||
codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id);
|
codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id);
|
||||||
break;
|
break;
|
||||||
case CODEC_ID_ADPCM_IMA_QT:
|
case CODEC_ID_ADPCM_IMA_QT:
|
||||||
@@ -137,7 +135,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
|
|||||||
size -= 4;
|
size -= 4;
|
||||||
} else {
|
} else {
|
||||||
/* Need the codec type */
|
/* Need the codec type */
|
||||||
codec->codec_id = aiff_codec_get_id (codec->bits_per_sample);
|
codec->codec_id = aiff_codec_get_id(codec->bits_per_sample);
|
||||||
codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id);
|
codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,10 +172,8 @@ static int aiff_write_header(AVFormatContext *s)
|
|||||||
int aifc = 0;
|
int aifc = 0;
|
||||||
|
|
||||||
/* First verify if format is ok */
|
/* First verify if format is ok */
|
||||||
if (!enc->codec_tag) {
|
if (!enc->codec_tag)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (enc->codec_tag != MKTAG('N','O','N','E'))
|
if (enc->codec_tag != MKTAG('N','O','N','E'))
|
||||||
aifc = 1;
|
aifc = 1;
|
||||||
|
|
||||||
@@ -202,10 +198,10 @@ static int aiff_write_header(AVFormatContext *s)
|
|||||||
/* Common chunk */
|
/* Common chunk */
|
||||||
put_tag(pb, "COMM");
|
put_tag(pb, "COMM");
|
||||||
put_be32(pb, aifc ? 24 : 18); /* size */
|
put_be32(pb, aifc ? 24 : 18); /* size */
|
||||||
put_be16(pb, enc->channels); /* Number of channels */
|
put_be16(pb, enc->channels); /* Number of channels */
|
||||||
|
|
||||||
aiff->frames = url_ftell(pb);
|
aiff->frames = url_ftell(pb);
|
||||||
put_be32(pb, 0); /* Number of frames */
|
put_be32(pb, 0); /* Number of frames */
|
||||||
|
|
||||||
if (!enc->bits_per_sample)
|
if (!enc->bits_per_sample)
|
||||||
enc->bits_per_sample = av_get_bits_per_sample(enc->codec_id);
|
enc->bits_per_sample = av_get_bits_per_sample(enc->codec_id);
|
||||||
@@ -343,27 +339,21 @@ static int aiff_read_header(AVFormatContext *s,
|
|||||||
if (offset > 0) // COMM is after SSND
|
if (offset > 0) // COMM is after SSND
|
||||||
goto got_sound;
|
goto got_sound;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MKTAG('F', 'V', 'E', 'R'): /* Version chunk */
|
case MKTAG('F', 'V', 'E', 'R'): /* Version chunk */
|
||||||
version = get_be32(pb);
|
version = get_be32(pb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MKTAG('N', 'A', 'M', 'E'): /* Sample name chunk */
|
case MKTAG('N', 'A', 'M', 'E'): /* Sample name chunk */
|
||||||
get_meta (pb, s->title, sizeof(s->title), size);
|
get_meta (pb, s->title, sizeof(s->title), size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MKTAG('A', 'U', 'T', 'H'): /* Author chunk */
|
case MKTAG('A', 'U', 'T', 'H'): /* Author chunk */
|
||||||
get_meta (pb, s->author, sizeof(s->author), size);
|
get_meta (pb, s->author, sizeof(s->author), size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MKTAG('(', 'c', ')', ' '): /* Copyright chunk */
|
case MKTAG('(', 'c', ')', ' '): /* Copyright chunk */
|
||||||
get_meta (pb, s->copyright, sizeof(s->copyright), size);
|
get_meta (pb, s->copyright, sizeof(s->copyright), size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MKTAG('A', 'N', 'N', 'O'): /* Annotation chunk */
|
case MKTAG('A', 'N', 'N', 'O'): /* Annotation chunk */
|
||||||
get_meta (pb, s->comment, sizeof(s->comment), size);
|
get_meta (pb, s->comment, sizeof(s->comment), size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MKTAG('S', 'S', 'N', 'D'): /* Sampled sound chunk */
|
case MKTAG('S', 'S', 'N', 'D'): /* Sampled sound chunk */
|
||||||
offset = get_be32(pb); /* Offset of sound data */
|
offset = get_be32(pb); /* Offset of sound data */
|
||||||
get_be32(pb); /* BlockSize... don't care */
|
get_be32(pb); /* BlockSize... don't care */
|
||||||
@@ -376,7 +366,6 @@ static int aiff_read_header(AVFormatContext *s,
|
|||||||
}
|
}
|
||||||
url_fskip(pb, size - 8);
|
url_fskip(pb, size - 8);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* Jump */
|
default: /* Jump */
|
||||||
if (size & 1) /* Always even aligned */
|
if (size & 1) /* Always even aligned */
|
||||||
size++;
|
size++;
|
||||||
|
Reference in New Issue
Block a user