1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-17 20:17:55 +02:00

movenc: K&R formatting cosmetics

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2013-07-07 14:59:47 +03:00
parent 38e9585de9
commit 21732063a3
2 changed files with 198 additions and 197 deletions

View File

@ -117,9 +117,8 @@ static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track)
for (i = 0; i < track->entry; i++) {
tst = track->cluster[i].size / track->cluster[i].entries;
if(oldtst != -1 && tst != oldtst) {
if (oldtst != -1 && tst != oldtst)
equalChunks = 0;
}
oldtst = tst;
entries += track->cluster[i].entries;
}
@ -128,8 +127,7 @@ static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track)
sSize = FFMAX(1, sSize); // adpcm mono case could make sSize == 0
avio_wb32(pb, sSize); // sample size
avio_wb32(pb, entries); // sample count
}
else {
} else {
avio_wb32(pb, 0); // sample size
avio_wb32(pb, entries); // sample count
for (i = 0; i < track->entry; i++) {
@ -155,8 +153,7 @@ static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track)
entryPos = avio_tell(pb);
avio_wb32(pb, track->entry); // entry count
for (i = 0; i < track->entry; i++) {
if (oldval != track->cluster[i].samples_in_chunk)
{
if (oldval != track->cluster[i].samples_in_chunk) {
avio_wb32(pb, i + 1); // first chunk
avio_wb32(pb, track->cluster[i].samples_in_chunk); // samples per chunk
avio_wb32(pb, 0x1); // sample description index
@ -308,7 +305,8 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
avio_wb24(pb, track->enc->rc_buffer_size >> 3); // Buffersize DB
avio_wb32(pb, FFMAX(track->enc->bit_rate, track->enc->rc_max_rate)); // maxbitrate (FIXME should be max rate in any 1 sec window)
if(track->enc->rc_max_rate != track->enc->rc_min_rate || track->enc->rc_min_rate==0)
if (track->enc->rc_max_rate != track->enc->rc_min_rate ||
track->enc->rc_min_rate == 0)
avio_wb32(pb, 0); // vbr
else
avio_wb32(pb, track->enc->rc_max_rate); // avg bitrate
@ -1425,8 +1423,7 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
avio_wb32(pb, sample_aspect_ratio * track->enc->width * 0x10000);
avio_wb32(pb, track->height * 0x10000);
}
}
else {
} else {
avio_wb32(pb, 0);
avio_wb32(pb, 0);
}
@ -1537,7 +1534,6 @@ static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov)
static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
{
AVFormatContext *ctx = track->rtp_ctx;
char buf[1000] = "";
int len;
@ -1580,7 +1576,7 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov,
double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio);
if (0.0 != sample_aspect_ratio && 1.0 != sample_aspect_ratio)
mov_write_tapt_tag(pb, track);
};
}
return update_size(pb, pos);
}
@ -1734,7 +1730,9 @@ static int mov_write_string_data_tag(AVIOContext *pb, const char *data, int lang
}
}
static int mov_write_string_tag(AVIOContext *pb, const char *name, const char *value, int lang, int long_style){
static int mov_write_string_tag(AVIOContext *pb, const char *name,
const char *value, int lang, int long_style)
{
int size = 0;
if (value && value[0]) {
int64_t pos = avio_tell(pb);
@ -1859,7 +1857,9 @@ static int ascii_to_wc(AVIOContext *pb, const uint8_t *b)
static uint16_t language_code(const char *str)
{
return (((str[0]-0x60) & 0x1F) << 10) + (((str[1]-0x60) & 0x1F) << 5) + ((str[2]-0x60) & 0x1F);
return (((str[0] - 0x60) & 0x1F) << 10) +
(((str[1] - 0x60) & 0x1F) << 5) +
(( str[2] - 0x60) & 0x1F);
}
static int mov_write_3gp_udta_tag(AVIOContext *pb, AVFormatContext *s,
@ -2945,7 +2945,8 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
int64_t frag_duration = 0;
int size = pkt->size;
if (!pkt->size) return 0; /* Discard 0 sized packets */
if (!pkt->size)
return 0; /* Discard 0 sized packets */
if (trk->entry)
frag_duration = av_rescale_q(pkt->dts - trk->cluster[0].dts,
@ -3244,7 +3245,6 @@ static int mov_write_trailer(AVFormatContext *s)
if (mov->tracks[i].vos_len)
av_free(mov->tracks[i].vos_data);
}
av_freep(&mov->tracks);

View File

@ -445,7 +445,8 @@ done:
return ret;
}
void ff_mov_close_hinting(MOVTrack *track) {
void ff_mov_close_hinting(MOVTrack *track)
{
AVFormatContext *rtp_ctx = track->rtp_ctx;
uint8_t *ptr;