mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-03 23:05:58 +08:00
cosmetics: whitespace, prettyprinting, coding style fixes
Originally committed as revision 19618 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -55,7 +55,7 @@ static int wav_write_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
ff_end_tag(pb, fmt);
|
ff_end_tag(pb, fmt);
|
||||||
|
|
||||||
if(s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */
|
if (s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */
|
||||||
&& !url_is_streamed(s->pb)) {
|
&& !url_is_streamed(s->pb)) {
|
||||||
fact = ff_start_tag(pb, "fact");
|
fact = ff_start_tag(pb, "fact");
|
||||||
put_le32(pb, 0);
|
put_le32(pb, 0);
|
||||||
@ -127,7 +127,7 @@ static int64_t find_tag(ByteIOContext *pb, uint32_t tag1)
|
|||||||
unsigned int tag;
|
unsigned int tag;
|
||||||
int64_t size;
|
int64_t size;
|
||||||
|
|
||||||
for(;;) {
|
for (;;) {
|
||||||
if (url_feof(pb))
|
if (url_feof(pb))
|
||||||
return -1;
|
return -1;
|
||||||
tag = get_le32(pb);
|
tag = get_le32(pb);
|
||||||
@ -144,9 +144,9 @@ static int wav_probe(AVProbeData *p)
|
|||||||
/* check file header */
|
/* check file header */
|
||||||
if (p->buf_size <= 32)
|
if (p->buf_size <= 32)
|
||||||
return 0;
|
return 0;
|
||||||
if (p->buf[0] == 'R' && p->buf[1] == 'I' &&
|
if (p->buf[ 0] == 'R' && p->buf[ 1] == 'I' &&
|
||||||
p->buf[2] == 'F' && p->buf[3] == 'F' &&
|
p->buf[ 2] == 'F' && p->buf[ 3] == 'F' &&
|
||||||
p->buf[8] == 'W' && p->buf[9] == 'A' &&
|
p->buf[ 8] == 'W' && p->buf[ 9] == 'A' &&
|
||||||
p->buf[10] == 'V' && p->buf[11] == 'E')
|
p->buf[10] == 'V' && p->buf[11] == 'E')
|
||||||
/*
|
/*
|
||||||
Since ACT demuxer has standard WAV header at top of it's own,
|
Since ACT demuxer has standard WAV header at top of it's own,
|
||||||
@ -217,9 +217,9 @@ static int w64_probe(AVProbeData *p)
|
|||||||
if (p->buf_size <= 40)
|
if (p->buf_size <= 40)
|
||||||
return 0;
|
return 0;
|
||||||
if (!memcmp(p->buf, guid_riff, 16) &&
|
if (!memcmp(p->buf, guid_riff, 16) &&
|
||||||
!memcmp(p->buf + 24, guid_wave, 16)) {
|
!memcmp(p->buf + 24, guid_wave, 16))
|
||||||
return AVPROBE_SCORE_MAX;
|
return AVPROBE_SCORE_MAX;
|
||||||
} else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,15 +308,14 @@ static int wav_read_packet(AVFormatContext *s,
|
|||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
st = s->streams[0];
|
st = s->streams[0];
|
||||||
|
|
||||||
left= wav->data_end - url_ftell(s->pb);
|
left = wav->data_end - url_ftell(s->pb);
|
||||||
if(left <= 0){
|
if (left <= 0){
|
||||||
if (CONFIG_W64_DEMUXER && wav->w64) {
|
if (CONFIG_W64_DEMUXER && wav->w64)
|
||||||
left = find_guid(s->pb, guid_data) - 24;
|
left = find_guid(s->pb, guid_data) - 24;
|
||||||
} else
|
else
|
||||||
left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
|
left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
|
||||||
if (left < 0) {
|
if (left < 0)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
}
|
|
||||||
wav->data_end= url_ftell(s->pb) + left;
|
wav->data_end= url_ftell(s->pb) + left;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,8 +325,8 @@ static int wav_read_packet(AVFormatContext *s,
|
|||||||
size = st->codec->block_align;
|
size = st->codec->block_align;
|
||||||
size = (size / st->codec->block_align) * st->codec->block_align;
|
size = (size / st->codec->block_align) * st->codec->block_align;
|
||||||
}
|
}
|
||||||
size= FFMIN(size, left);
|
size = FFMIN(size, left);
|
||||||
ret= av_get_packet(s->pb, pkt, size);
|
ret = av_get_packet(s->pb, pkt, size);
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
pkt->stream_index = 0;
|
pkt->stream_index = 0;
|
||||||
@ -344,7 +343,7 @@ static int wav_read_seek(AVFormatContext *s,
|
|||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
|
||||||
st = s->streams[0];
|
st = s->streams[0];
|
||||||
switch(st->codec->codec_id) {
|
switch (st->codec->codec_id) {
|
||||||
case CODEC_ID_MP2:
|
case CODEC_ID_MP2:
|
||||||
case CODEC_ID_MP3:
|
case CODEC_ID_MP3:
|
||||||
case CODEC_ID_AC3:
|
case CODEC_ID_AC3:
|
||||||
@ -371,6 +370,7 @@ AVInputFormat wav_demuxer = {
|
|||||||
.codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
|
.codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_WAV_MUXER
|
#if CONFIG_WAV_MUXER
|
||||||
AVOutputFormat wav_muxer = {
|
AVOutputFormat wav_muxer = {
|
||||||
"wav",
|
"wav",
|
||||||
@ -386,6 +386,7 @@ AVOutputFormat wav_muxer = {
|
|||||||
.codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
|
.codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_W64_DEMUXER
|
#if CONFIG_W64_DEMUXER
|
||||||
AVInputFormat w64_demuxer = {
|
AVInputFormat w64_demuxer = {
|
||||||
"w64",
|
"w64",
|
||||||
|
Reference in New Issue
Block a user