Commit c5e86106 authored by Diego Biurrun's avatar Diego Biurrun

cosmetics: whitespace, prettyprinting, coding style fixes

Originally committed as revision 19618 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 740e89cf
...@@ -55,8 +55,8 @@ static int wav_write_header(AVFormatContext *s) ...@@ -55,8 +55,8 @@ 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);
ff_end_tag(pb, fact); ff_end_tag(pb, fact);
...@@ -76,12 +76,12 @@ static int wav_write_header(AVFormatContext *s) ...@@ -76,12 +76,12 @@ static int wav_write_header(AVFormatContext *s)
static int wav_write_packet(AVFormatContext *s, AVPacket *pkt) static int wav_write_packet(AVFormatContext *s, AVPacket *pkt)
{ {
ByteIOContext *pb = s->pb; ByteIOContext *pb = s->pb;
WAVContext *wav = s->priv_data; WAVContext *wav = s->priv_data;
put_buffer(pb, pkt->data, pkt->size); put_buffer(pb, pkt->data, pkt->size);
if(pkt->pts != AV_NOPTS_VALUE) { if(pkt->pts != AV_NOPTS_VALUE) {
wav->minpts = FFMIN(wav->minpts, pkt->pts); wav->minpts = FFMIN(wav->minpts, pkt->pts);
wav->maxpts = FFMAX(wav->maxpts, pkt->pts); wav->maxpts = FFMAX(wav->maxpts, pkt->pts);
wav->last_duration = pkt->duration; wav->last_duration = pkt->duration;
} else } else
av_log(s, AV_LOG_ERROR, "wav_write_packet: NOPTS\n"); av_log(s, AV_LOG_ERROR, "wav_write_packet: NOPTS\n");
...@@ -90,8 +90,8 @@ static int wav_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -90,8 +90,8 @@ static int wav_write_packet(AVFormatContext *s, AVPacket *pkt)
static int wav_write_trailer(AVFormatContext *s) static int wav_write_trailer(AVFormatContext *s)
{ {
ByteIOContext *pb = s->pb; ByteIOContext *pb = s->pb;
WAVContext *wav = s->priv_data; WAVContext *wav = s->priv_data;
int64_t file_size; int64_t file_size;
if (!url_is_streamed(s->pb)) { if (!url_is_streamed(s->pb)) {
...@@ -127,10 +127,10 @@ static int64_t find_tag(ByteIOContext *pb, uint32_t tag1) ...@@ -127,10 +127,10 @@ 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);
size = get_le32(pb); size = get_le32(pb);
if (tag == tag1) if (tag == tag1)
break; break;
...@@ -144,9 +144,9 @@ static int wav_probe(AVProbeData *p) ...@@ -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) ...@@ -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;
} }
...@@ -246,8 +246,8 @@ static int64_t find_guid(ByteIOContext *pb, const uint8_t guid1[16]) ...@@ -246,8 +246,8 @@ static int64_t find_guid(ByteIOContext *pb, const uint8_t guid1[16])
static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap) static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
int64_t size; int64_t size;
ByteIOContext *pb = s->pb; ByteIOContext *pb = s->pb;
WAVContext *wav = s->priv_data; WAVContext *wav = s->priv_data;
AVStream *st; AVStream *st;
uint8_t guid[16]; uint8_t guid[16];
...@@ -288,7 +288,7 @@ static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -288,7 +288,7 @@ static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1; return -1;
} }
wav->data_end = url_ftell(pb) + size - 24; wav->data_end = url_ftell(pb) + size - 24;
wav->w64 = 1; wav->w64 = 1;
return 0; return 0;
} }
...@@ -308,15 +308,14 @@ static int wav_read_packet(AVFormatContext *s, ...@@ -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, ...@@ -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, ...@@ -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 = { ...@@ -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 = { ...@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment