Commit 7167084d authored by bcoudurier's avatar bcoudurier

cosmetics

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13731 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent cc965836
...@@ -81,7 +81,7 @@ typedef struct MOVContext { ...@@ -81,7 +81,7 @@ typedef struct MOVContext {
} MOVContext; } MOVContext;
//FIXME support 64 bit variant with wide placeholders //FIXME support 64 bit variant with wide placeholders
static offset_t updateSize (ByteIOContext *pb, offset_t pos) static offset_t updateSize(ByteIOContext *pb, offset_t pos)
{ {
offset_t curpos = url_ftell(pb); offset_t curpos = url_ftell(pb);
url_fseek(pb, pos, SEEK_SET); url_fseek(pb, pos, SEEK_SET);
...@@ -92,7 +92,7 @@ static offset_t updateSize (ByteIOContext *pb, offset_t pos) ...@@ -92,7 +92,7 @@ static offset_t updateSize (ByteIOContext *pb, offset_t pos)
} }
/* Chunk offset atom */ /* Chunk offset atom */
static int mov_write_stco_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_stco_tag(ByteIOContext *pb, MOVTrack *track)
{ {
int i; int i;
int mode64 = 0; // use 32 bit size variant if possible int mode64 = 0; // use 32 bit size variant if possible
...@@ -115,7 +115,7 @@ static int mov_write_stco_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -115,7 +115,7 @@ static int mov_write_stco_tag(ByteIOContext *pb, MOVTrack* track)
} }
/* Sample size atom */ /* Sample size atom */
static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack *track)
{ {
int equalChunks = 1; int equalChunks = 1;
int i, j, entries = 0, tst = -1, oldtst = -1; int i, j, entries = 0, tst = -1, oldtst = -1;
...@@ -152,7 +152,7 @@ static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -152,7 +152,7 @@ static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack* track)
} }
/* Sample to chunk atom */ /* Sample to chunk atom */
static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack *track)
{ {
int index = 0, oldval = -1, i; int index = 0, oldval = -1, i;
offset_t entryPos, curpos; offset_t entryPos, curpos;
...@@ -182,7 +182,7 @@ static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -182,7 +182,7 @@ static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack* track)
} }
/* Sync sample atom */ /* Sync sample atom */
static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t curpos, entryPos; offset_t curpos, entryPos;
int i, index = 0; int i, index = 0;
...@@ -253,7 +253,7 @@ static void putDescr(ByteIOContext *pb, int tag, unsigned int size) ...@@ -253,7 +253,7 @@ static void putDescr(ByteIOContext *pb, int tag, unsigned int size)
put_byte(pb, size & 0x7F); put_byte(pb, size & 0x7F);
} }
static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track) // Basic static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0; int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0;
...@@ -302,7 +302,7 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track) // Basic ...@@ -302,7 +302,7 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track) // Basic
return updateSize (pb, pos); return updateSize (pb, pos);
} }
static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
...@@ -334,7 +334,7 @@ static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -334,7 +334,7 @@ static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize (pb, pos); return updateSize (pb, pos);
} }
static int mov_write_glbl_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_glbl_tag(ByteIOContext *pb, MOVTrack *track)
{ {
put_be32(pb, track->vosLen+8); put_be32(pb, track->vosLen+8);
put_tag(pb, "glbl"); put_tag(pb, "glbl");
...@@ -342,7 +342,7 @@ static int mov_write_glbl_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -342,7 +342,7 @@ static int mov_write_glbl_tag(ByteIOContext *pb, MOVTrack* track)
return 8+track->vosLen; return 8+track->vosLen;
} }
static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
int version = track->mode == MODE_MOV && int version = track->mode == MODE_MOV &&
...@@ -569,7 +569,7 @@ static int mov_write_uuid_tag_ipod(ByteIOContext *pb) ...@@ -569,7 +569,7 @@ static int mov_write_uuid_tag_ipod(ByteIOContext *pb)
return 28; return 28;
} }
static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
char compressor_name[32]; char compressor_name[32];
...@@ -633,7 +633,7 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -633,7 +633,7 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize (pb, pos); return updateSize (pb, pos);
} }
static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
put_be32(pb, 0); /* size */ put_be32(pb, 0); /* size */
...@@ -647,7 +647,7 @@ static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -647,7 +647,7 @@ static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize(pb, pos); return updateSize(pb, pos);
} }
static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack *track)
{ {
MOV_stts_t *ctts_entries; MOV_stts_t *ctts_entries;
uint32_t entries = 0; uint32_t entries = 0;
...@@ -681,7 +681,7 @@ static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -681,7 +681,7 @@ static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack* track)
} }
/* Time to sample atom */ /* Time to sample atom */
static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack *track)
{ {
MOV_stts_t *stts_entries; MOV_stts_t *stts_entries;
uint32_t entries = -1; uint32_t entries = -1;
...@@ -736,7 +736,7 @@ static int mov_write_dref_tag(ByteIOContext *pb) ...@@ -736,7 +736,7 @@ static int mov_write_dref_tag(ByteIOContext *pb)
return 28; return 28;
} }
static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
put_be32(pb, 0); /* size */ put_be32(pb, 0); /* size */
...@@ -783,7 +783,7 @@ static int mov_write_vmhd_tag(ByteIOContext *pb) ...@@ -783,7 +783,7 @@ static int mov_write_vmhd_tag(ByteIOContext *pb)
return 0x14; return 0x14;
} }
static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)
{ {
const char *descr, *hdlr, *hdlr_type; const char *descr, *hdlr, *hdlr_type;
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
...@@ -816,7 +816,7 @@ static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -816,7 +816,7 @@ static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize(pb, pos); return updateSize(pb, pos);
} }
static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
put_be32(pb, 0); /* size */ put_be32(pb, 0); /* size */
...@@ -832,7 +832,7 @@ static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -832,7 +832,7 @@ static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize(pb, pos); return updateSize(pb, pos);
} }
static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack *track)
{ {
int version = track->trackDuration < INT32_MAX ? 0 : 1; int version = track->trackDuration < INT32_MAX ? 0 : 1;
...@@ -862,7 +862,7 @@ static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -862,7 +862,7 @@ static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack* track)
return 32; return 32;
} }
static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
put_be32(pb, 0); /* size */ put_be32(pb, 0); /* size */
...@@ -873,7 +873,7 @@ static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -873,7 +873,7 @@ static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize(pb, pos); return updateSize(pb, pos);
} }
static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track)
{ {
int64_t duration = av_rescale_rnd(track->trackDuration, globalTimescale, track->timescale, AV_ROUND_UP); int64_t duration = av_rescale_rnd(track->trackDuration, globalTimescale, track->timescale, AV_ROUND_UP);
int version = duration < INT32_MAX ? 0 : 1; int version = duration < INT32_MAX ? 0 : 1;
...@@ -964,7 +964,7 @@ static int mov_write_uuid_tag_psp(ByteIOContext *pb, MOVTrack *mov) ...@@ -964,7 +964,7 @@ static int mov_write_uuid_tag_psp(ByteIOContext *pb, MOVTrack *mov)
return 0x34; return 0x34;
} }
static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack *track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
put_be32(pb, 0); /* size */ put_be32(pb, 0); /* size */
...@@ -1052,7 +1052,7 @@ static int mov_write_mvhd_tag(ByteIOContext *pb, MOVContext *mov) ...@@ -1052,7 +1052,7 @@ static int mov_write_mvhd_tag(ByteIOContext *pb, MOVContext *mov)
return 0x6c; return 0x6c;
} }
static int mov_write_itunes_hdlr_tag(ByteIOContext *pb, MOVContext* mov, static int mov_write_itunes_hdlr_tag(ByteIOContext *pb, MOVContext *mov,
AVFormatContext *s) AVFormatContext *s)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
...@@ -1111,7 +1111,7 @@ static int mov_write_day_tag(ByteIOContext *pb, int year, int long_style) ...@@ -1111,7 +1111,7 @@ static int mov_write_day_tag(ByteIOContext *pb, int year, int long_style)
} }
/* iTunes track number */ /* iTunes track number */
static int mov_write_trkn_tag(ByteIOContext *pb, MOVContext* mov, static int mov_write_trkn_tag(ByteIOContext *pb, MOVContext *mov,
AVFormatContext *s) AVFormatContext *s)
{ {
int size = 0; int size = 0;
...@@ -1137,7 +1137,7 @@ static int mov_write_trkn_tag(ByteIOContext *pb, MOVContext* mov, ...@@ -1137,7 +1137,7 @@ static int mov_write_trkn_tag(ByteIOContext *pb, MOVContext* mov,
} }
/* iTunes meta data list */ /* iTunes meta data list */
static int mov_write_ilst_tag(ByteIOContext *pb, MOVContext* mov, static int mov_write_ilst_tag(ByteIOContext *pb, MOVContext *mov,
AVFormatContext *s) AVFormatContext *s)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
...@@ -1157,7 +1157,7 @@ static int mov_write_ilst_tag(ByteIOContext *pb, MOVContext* mov, ...@@ -1157,7 +1157,7 @@ static int mov_write_ilst_tag(ByteIOContext *pb, MOVContext* mov,
} }
/* iTunes meta data tag */ /* iTunes meta data tag */
static int mov_write_meta_tag(ByteIOContext *pb, MOVContext* mov, static int mov_write_meta_tag(ByteIOContext *pb, MOVContext *mov,
AVFormatContext *s) AVFormatContext *s)
{ {
int size = 0; int size = 0;
...@@ -1176,7 +1176,7 @@ static int mov_write_meta_tag(ByteIOContext *pb, MOVContext* mov, ...@@ -1176,7 +1176,7 @@ static int mov_write_meta_tag(ByteIOContext *pb, MOVContext* mov,
return size; return size;
} }
static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov, static int mov_write_udta_tag(ByteIOContext *pb, MOVContext *mov,
AVFormatContext *s) AVFormatContext *s)
{ {
int i, req = 0; int i, req = 0;
...@@ -1224,7 +1224,8 @@ static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov, ...@@ -1224,7 +1224,8 @@ static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,
return 0; return 0;
} }
static int utf8len(const uint8_t *b){ static int utf8len(const uint8_t *b)
{
int len=0; int len=0;
int val; int val;
while(*b){ while(*b){
...@@ -1234,7 +1235,7 @@ static int utf8len(const uint8_t *b){ ...@@ -1234,7 +1235,7 @@ static int utf8len(const uint8_t *b){
return len; return len;
} }
static int ascii_to_wc (ByteIOContext *pb, const uint8_t *b) static int ascii_to_wc(ByteIOContext *pb, const uint8_t *b)
{ {
int val; int val;
while(*b){ while(*b){
...@@ -1245,12 +1246,12 @@ static int ascii_to_wc (ByteIOContext *pb, const uint8_t *b) ...@@ -1245,12 +1246,12 @@ static int ascii_to_wc (ByteIOContext *pb, const uint8_t *b)
return 0; return 0;
} }
static uint16_t language_code (const char *str) 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_uuidusmt_tag (ByteIOContext *pb, AVFormatContext *s) static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s)
{ {
size_t len, size; size_t len, size;
offset_t pos, curpos; offset_t pos, curpos;
...@@ -1360,7 +1361,7 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov, ...@@ -1360,7 +1361,7 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov,
return updateSize(pb, pos); return updateSize(pb, pos);
} }
static int mov_write_mdat_tag(ByteIOContext *pb, MOVContext* mov) static int mov_write_mdat_tag(ByteIOContext *pb, MOVContext *mov)
{ {
put_be32(pb, 8); // placeholder for extended size field (64 bit) put_be32(pb, 8); // placeholder for extended size field (64 bit)
put_tag(pb, mov->mode == MODE_MOV ? "wide" : "free"); put_tag(pb, mov->mode == MODE_MOV ? "wide" : "free");
......
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