| @@ -70,7 +70,7 @@ static const AVClass flavor ## _muxer_class = {\ · 69 unmodified lines |
| 70 | 70 | }; |
| 71 | 71 | |
| 72 | 72 | //FIXME support 64 bit variant with wide placeholders |
| 73 | | −static int64_t updateSize(AVIOContext *pb, int64_t pos) |
| 73 | +static int64_t update_size(AVIOContext *pb, int64_t pos) |
| 74 | 74 | { |
| 75 | 75 | int64_t curpos = avio_tell(pb); |
| 76 | 76 | avio_seek(pb, pos, SEEK_SET); |
| @@ -102,7 +102,7 @@ static int mov_write_stco_tag(AVIOContext *pb, MOVTrack *track) · 25 unmodified lines |
| 102 | 102 | else |
| 103 | 103 | avio_wb32(pb, track->cluster[i].pos); |
| 104 | 104 | } |
| 105 | | − return updateSize(pb, pos); |
| 105 | + return update_size(pb, pos); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /* Sample size atom */ |
| @@ -140,7 +140,7 @@ static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track) · 31 unmodified lines |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | | − return updateSize(pb, pos); |
| 143 | + return update_size(pb, pos); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /* Sample to chunk atom */ |
| @@ -156,12 +156,12 @@ static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track) · 9 unmodified lines |
| 156 | 156 | entryPos = avio_tell(pb); |
| 157 | 157 | avio_wb32(pb, track->chunkCount); // entry count |
| 158 | 158 | for (i=0; i<track->entry; i++) { |
| 159 | | − if(oldval != track->cluster[i].samplesInChunk && track->cluster[i].chunkNum) |
| 159 | + if (oldval != track->cluster[i].samples_in_chunk && track->cluster[i].chunkNum) |
| 160 | 160 | { |
| 161 | 161 | avio_wb32(pb, track->cluster[i].chunkNum); // first chunk |
| 162 | | − avio_wb32(pb, track->cluster[i].samplesInChunk); // samples per chunk |
| 162 | + avio_wb32(pb, track->cluster[i].samples_in_chunk); // samples per chunk |
| 163 | 163 | avio_wb32(pb, 0x1); // sample description index |
| 164 | | − oldval = track->cluster[i].samplesInChunk; |
| 164 | + oldval = track->cluster[i].samples_in_chunk; |
| 165 | 165 | index++; |
| 166 | 166 | } |
| 167 | 167 | } |
| @@ -170,7 +170,7 @@ static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track) · 2 unmodified lines |
| 170 | 170 | avio_wb32(pb, index); // rewrite size |
| 171 | 171 | avio_seek(pb, curpos, SEEK_SET); |
| 172 | 172 | |
| 173 | | − return updateSize(pb, pos); |
| 173 | + return update_size(pb, pos); |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /* Sync sample atom */ |
| @@ -194,7 +194,7 @@ static int mov_write_stss_tag(AVIOContext *pb, MOVTrack *track, uint32_t flag) · 17 unmodified lines |
| 194 | 194 | avio_seek(pb, entryPos, SEEK_SET); |
| 195 | 195 | avio_wb32(pb, index); // rewrite size |
| 196 | 196 | avio_seek(pb, curpos, SEEK_SET); |
| 197 | | − return updateSize(pb, pos); |
| 197 | + return update_size(pb, pos); |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | static int mov_write_amr_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -218,13 +218,13 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track) · 17 unmodified lines |
| 218 | 218 | uint8_t buf[3]; |
| 219 | 219 | int fscod, bsid, bsmod, acmod, lfeon, frmsizecod; |
| 220 | 220 | |
| 221 | | − if (track->vosLen < 7) |
| 221 | + if (track->vos_len < 7) |
| 222 | 222 | return -1; |
| 223 | 223 | |
| 224 | 224 | avio_wb32(pb, 11); |
| 225 | 225 | ffio_wfourcc(pb, "dac3"); |
| 226 | 226 | |
| 227 | | − init_get_bits(&gbc, track->vosData+4, (track->vosLen-4) * 8); |
| 227 | + init_get_bits(&gbc, track->vos_data + 4, (track->vos_len - 4) * 8); |
| 228 | 228 | fscod = get_bits(&gbc, 2); |
| 229 | 229 | frmsizecod = get_bits(&gbc, 6); |
| 230 | 230 | bsid = get_bits(&gbc, 5); |
| @@ -273,7 +273,7 @@ static int mov_write_enda_tag(AVIOContext *pb) · 42 unmodified lines |
| 273 | 273 | return 10; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | | −static void putDescr(AVIOContext *pb, int tag, unsigned int size) |
| 276 | +static void put_descr(AVIOContext *pb, int tag, unsigned int size) |
| 277 | 277 | { |
| 278 | 278 | int i = 3; |
| 279 | 279 | avio_w8(pb, tag); |
| @@ -288,13 +288,13 @@ static unsigned compute_avg_bitrate(MOVTrack *track) · 8 unmodified lines |
| 288 | 288 | int i; |
| 289 | 289 | for (i = 0; i < track->entry; i++) |
| 290 | 290 | size += track->cluster[i].size; |
| 291 | | − return size * 8 * track->timescale / track->trackDuration; |
| 291 | + return size * 8 * track->timescale / track->track_duration; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic |
| 295 | 295 | { |
| 296 | 296 | int64_t pos = avio_tell(pb); |
| 297 | | − int decoderSpecificInfoLen = track->vosLen ? 5+track->vosLen : 0; |
| 297 | + int decoder_specific_info_len = track->vos_len ? 5 + track->vos_len : 0; |
| 298 | 298 | unsigned avg_bitrate; |
| 299 | 299 | |
| 300 | 300 | avio_wb32(pb, 0); // size |
| @@ -302,12 +302,12 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic · 1 unmodified line |
| 302 | 302 | avio_wb32(pb, 0); // Version |
| 303 | 303 | |
| 304 | 304 | // ES descriptor |
| 305 | | − putDescr(pb, 0x03, 3 + 5+13 + decoderSpecificInfoLen + 5+1); |
| 306 | | − avio_wb16(pb, track->trackID); |
| 305 | + put_descr(pb, 0x03, 3 + 5+13 + decoder_specific_info_len + 5+1); |
| 306 | + avio_wb16(pb, track->track_id); |
| 307 | 307 | avio_w8(pb, 0x00); // flags (= no flags) |
| 308 | 308 | |
| 309 | 309 | // DecoderConfig descriptor |
| 310 | | − putDescr(pb, 0x04, 13 + decoderSpecificInfoLen); |
| 310 | + put_descr(pb, 0x04, 13 + decoder_specific_info_len); |
| 311 | 311 | |
| 312 | 312 | // Object type indication |
| 313 | 313 | if ((track->enc->codec_id == CODEC_ID_MP2 || |
| @@ -332,16 +332,16 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic · 18 unmodified lines |
| 332 | 332 | avio_wb32(pb, FFMAX3(track->enc->bit_rate, track->enc->rc_max_rate, avg_bitrate)); |
| 333 | 333 | avio_wb32(pb, avg_bitrate); |
| 334 | 334 | |
| 335 | | − if (track->vosLen) { |
| 335 | + if (track->vos_len) { |
| 336 | 336 | // DecoderSpecific info descriptor |
| 337 | | − putDescr(pb, 0x05, track->vosLen); |
| 338 | | − avio_write(pb, track->vosData, track->vosLen); |
| 337 | + put_descr(pb, 0x05, track->vos_len); |
| 338 | + avio_write(pb, track->vos_data, track->vos_len); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | // SL descriptor |
| 342 | | − putDescr(pb, 0x06, 1); |
| 342 | + put_descr(pb, 0x06, 1); |
| 343 | 343 | avio_w8(pb, 0x02); |
| 344 | | − return updateSize(pb, pos); |
| 344 | + return update_size(pb, pos); |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | static int mov_pcm_le_gt16(enum CodecID codec_id) |
| @@ -359,7 +359,7 @@ static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track) · 11 unmodified lines |
| 359 | 359 | avio_wl32(pb, track->tag); // store it byteswapped |
| 360 | 360 | track->enc->codec_tag = av_bswap16(track->tag >> 16); |
| 361 | 361 | ff_put_wav_header(pb, track->enc); |
| 362 | | − return updateSize(pb, pos); |
| 362 | + return update_size(pb, pos); |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -384,7 +384,7 @@ static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track) · 18 unmodified lines |
| 384 | 384 | avio_wb32(pb, bitmap); // mChannelBitmap |
| 385 | 385 | avio_wb32(pb, 0); // mNumberChannelDescriptions |
| 386 | 386 | |
| 387 | | − return updateSize(pb, pos); |
| 387 | + return update_size(pb, pos); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -421,15 +421,15 @@ static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track) · 30 unmodified lines |
| 421 | 421 | avio_wb32(pb, 8); /* size */ |
| 422 | 422 | avio_wb32(pb, 0); /* null tag */ |
| 423 | 423 | |
| 424 | | − return updateSize(pb, pos); |
| 424 | + return update_size(pb, pos); |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | static int mov_write_glbl_tag(AVIOContext *pb, MOVTrack *track) |
| 428 | 428 | { |
| 429 | | − avio_wb32(pb, track->vosLen+8); |
| 429 | + avio_wb32(pb, track->vos_len + 8); |
| 430 | 430 | ffio_wfourcc(pb, "glbl"); |
| 431 | | − avio_write(pb, track->vosData, track->vosLen); |
| 432 | | − return 8+track->vosLen; |
| 431 | + avio_write(pb, track->vos_data, track->vos_len); |
| 432 | + return 8 + track->vos_len; |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /** |
| @@ -502,7 +502,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) · 66 unmodified lines |
| 502 | 502 | avio_wb32(pb, 0x7F000000); |
| 503 | 503 | avio_wb32(pb, av_get_bits_per_sample(track->enc->codec_id)); |
| 504 | 504 | avio_wb32(pb, mov_get_lpcm_flags(track->enc->codec_id)); |
| 505 | | − avio_wb32(pb, track->sampleSize); |
| 505 | + avio_wb32(pb, track->sample_size); |
| 506 | 506 | avio_wb32(pb, track->enc->frame_size); |
| 507 | 507 | } else { |
| 508 | 508 | if (track->mode == MODE_MOV) { |
| @@ -526,8 +526,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) · 17 unmodified lines |
| 526 | 526 | |
| 527 | 527 | if(version == 1) { /* SoundDescription V1 extended info */ |
| 528 | 528 | avio_wb32(pb, track->enc->frame_size); /* Samples per packet */ |
| 529 | | − avio_wb32(pb, track->sampleSize / track->enc->channels); /* Bytes per packet */ |
| 530 | | − avio_wb32(pb, track->sampleSize); /* Bytes per frame */ |
| 529 | + avio_wb32(pb, track->sample_size / track->enc->channels); /* Bytes per packet */ |
| 530 | + avio_wb32(pb, track->sample_size); /* Bytes per frame */ |
| 531 | 531 | avio_wb32(pb, 2); /* Bytes per sample */ |
| 532 | 532 | } |
| 533 | 533 | |
| @@ -548,10 +548,10 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) · 14 unmodified lines |
| 548 | 548 | mov_write_ac3_tag(pb, track); |
| 549 | 549 | else if(track->enc->codec_id == CODEC_ID_ALAC) |
| 550 | 550 | mov_write_extradata_tag(pb, track); |
| 551 | | − else if(track->vosLen > 0) |
| 551 | + else if (track->vos_len > 0) |
| 552 | 552 | mov_write_glbl_tag(pb, track); |
| 553 | 553 | |
| 554 | | − return updateSize(pb, pos); |
| 554 | + return update_size(pb, pos); |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | static int mov_write_d263_tag(AVIOContext *pb) |
| @@ -585,8 +585,8 @@ static int mov_write_avcc_tag(AVIOContext *pb, MOVTrack *track) · 27 unmodified lines |
| 585 | 585 | |
| 586 | 586 | avio_wb32(pb, 0); |
| 587 | 587 | ffio_wfourcc(pb, "avcC"); |
| 588 | | − ff_isom_write_avcc(pb, track->vosData, track->vosLen); |
| 589 | | − return updateSize(pb, pos); |
| 588 | + ff_isom_write_avcc(pb, track->vos_data, track->vos_len); |
| 589 | + return update_size(pb, pos); |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | /* also used by all avid codecs (dv, imx, meridien) and their variants */ |
| @@ -611,10 +611,10 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track) · 18 unmodified lines |
| 611 | 611 | ffio_wfourcc(pb, "ARES"); |
| 612 | 612 | ffio_wfourcc(pb, "ARES"); |
| 613 | 613 | ffio_wfourcc(pb, "0001"); |
| 614 | | − avio_wb32(pb, AV_RB32(track->vosData + 0x28)); /* dnxhd cid, some id ? */ |
| 614 | + avio_wb32(pb, AV_RB32(track->vos_data + 0x28)); /* dnxhd cid, some id ? */ |
| 615 | 615 | avio_wb32(pb, track->enc->width); |
| 616 | 616 | /* values below are based on samples created with quicktime and avid codecs */ |
| 617 | | − if (track->vosData[5] & 2) { // interlaced |
| 617 | + if (track->vos_data[5] & 2) { // interlaced |
| 618 | 618 | avio_wb32(pb, track->enc->height/2); |
| 619 | 619 | avio_wb32(pb, 2); /* unknown */ |
| 620 | 620 | avio_wb32(pb, 0); /* unknown */ |
| @@ -854,7 +854,7 @@ static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track) · 233 unmodified lines |
| 854 | 854 | if (track->enc->extradata_size) |
| 855 | 855 | avio_write(pb, track->enc->extradata, track->enc->extradata_size); |
| 856 | 856 | |
| 857 | | − return updateSize(pb, pos); |
| 857 | + return update_size(pb, pos); |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | 860 | static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -930,7 +930,7 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track) · 69 unmodified lines |
| 930 | 930 | mov_write_uuid_tag_ipod(pb); |
| 931 | 931 | } else if (track->enc->field_order != AV_FIELD_UNKNOWN) |
| 932 | 932 | mov_write_fiel_tag(pb, track); |
| 933 | | − else if(track->vosLen > 0) |
| 933 | + else if (track->vos_len > 0) |
| 934 | 934 | mov_write_glbl_tag(pb, track); |
| 935 | 935 | |
| 936 | 936 | if (track->enc->sample_aspect_ratio.den && track->enc->sample_aspect_ratio.num && |
| @@ -938,7 +938,7 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track) · 1 unmodified line |
| 938 | 938 | mov_write_pasp_tag(pb, track); |
| 939 | 939 | } |
| 940 | 940 | |
| 941 | | − return updateSize(pb, pos); |
| 941 | + return update_size(pb, pos); |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -958,7 +958,7 @@ static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track) · 13 unmodified lines |
| 958 | 958 | ffio_wfourcc(pb, "tims"); |
| 959 | 959 | avio_wb32(pb, track->timescale); |
| 960 | 960 | |
| 961 | | − return updateSize(pb, pos); |
| 961 | + return update_size(pb, pos); |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | static int mov_write_stsd_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -976,7 +976,7 @@ static int mov_write_stsd_tag(AVIOContext *pb, MOVTrack *track) · 11 unmodified lines |
| 976 | 976 | mov_write_subtitle_tag(pb, track); |
| 977 | 977 | else if (track->enc->codec_tag == MKTAG('r','t','p',' ')) |
| 978 | 978 | mov_write_rtp_tag(pb, track); |
| 979 | | − return updateSize(pb, pos); |
| 979 | + return update_size(pb, pos); |
| 980 | 980 | } |
| 981 | 981 | |
| 982 | 982 | static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -1022,7 +1022,7 @@ static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track) · 39 unmodified lines |
| 1022 | 1022 | |
| 1023 | 1023 | if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO && !track->audio_vbr) { |
| 1024 | 1024 | stts_entries = av_malloc(sizeof(*stts_entries)); /* one entry */ |
| 1025 | | − stts_entries[0].count = track->sampleCount; |
| 1025 | + stts_entries[0].count = track->sample_count; |
| 1026 | 1026 | stts_entries[0].duration = 1; |
| 1027 | 1027 | entries = 1; |
| 1028 | 1028 | } else { |
| @@ -1031,7 +1031,7 @@ static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track) · 2 unmodified lines |
| 1031 | 1031 | NULL; |
| 1032 | 1032 | for (i=0; i<track->entry; i++) { |
| 1033 | 1033 | int64_t duration = i + 1 == track->entry ? |
| 1034 | | − track->trackDuration - track->cluster[i].dts + track->start_dts : /* readjusting */ |
| 1034 | + track->track_duration - track->cluster[i].dts + track->start_dts : /* readjusting */ |
| 1035 | 1035 | track->cluster[i+1].dts - track->cluster[i].dts; |
| 1036 | 1036 | if (i && duration == stts_entries[entries].duration) { |
| 1037 | 1037 | stts_entries[entries].count++; /* compress */ |
| @@ -1080,7 +1080,7 @@ static int mov_write_stbl_tag(AVIOContext *pb, MOVTrack *track) · 42 unmodified lines |
| 1080 | 1080 | mov_write_stts_tag(pb, track); |
| 1081 | 1081 | if ((track->enc->codec_type == AVMEDIA_TYPE_VIDEO || |
| 1082 | 1082 | track->enc->codec_tag == MKTAG('r','t','p',' ')) && |
| 1083 | | − track->hasKeyframes && track->hasKeyframes < track->entry) |
| 1083 | + track->has_keyframes && track->has_keyframes < track->entry) |
| 1084 | 1084 | mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE); |
| 1085 | 1085 | if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS) |
| 1086 | 1086 | mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE); |
| @@ -1090,7 +1090,7 @@ static int mov_write_stbl_tag(AVIOContext *pb, MOVTrack *track) · 3 unmodified lines |
| 1090 | 1090 | mov_write_stsc_tag(pb, track); |
| 1091 | 1091 | mov_write_stsz_tag(pb, track); |
| 1092 | 1092 | mov_write_stco_tag(pb, track); |
| 1093 | | − return updateSize(pb, pos); |
| 1093 | + return update_size(pb, pos); |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | 1096 | static int mov_write_dinf_tag(AVIOContext *pb) |
| @@ -1099,7 +1099,7 @@ static int mov_write_dinf_tag(AVIOContext *pb) · 2 unmodified lines |
| 1099 | 1099 | avio_wb32(pb, 0); /* size */ |
| 1100 | 1100 | ffio_wfourcc(pb, "dinf"); |
| 1101 | 1101 | mov_write_dref_tag(pb); |
| 1102 | | − return updateSize(pb, pos); |
| 1102 | + return update_size(pb, pos); |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | static int mov_write_nmhd_tag(AVIOContext *pb) |
| @@ -1185,7 +1185,7 @@ static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track) · 79 unmodified lines |
| 1185 | 1185 | avio_write(pb, descr, strlen(descr)); /* handler description */ |
| 1186 | 1186 | if (track && track->mode != MODE_MOV) |
| 1187 | 1187 | avio_w8(pb, 0); /* c string */ |
| 1188 | | − return updateSize(pb, pos); |
| 1188 | + return update_size(pb, pos); |
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | static int mov_write_hmhd_tag(AVIOContext *pb) |
| @@ -1222,12 +1222,12 @@ static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track) · 30 unmodified lines |
| 1222 | 1222 | mov_write_hdlr_tag(pb, NULL); |
| 1223 | 1223 | mov_write_dinf_tag(pb); |
| 1224 | 1224 | mov_write_stbl_tag(pb, track); |
| 1225 | | − return updateSize(pb, pos); |
| 1225 | + return update_size(pb, pos); |
| 1226 | 1226 | } |
| 1227 | 1227 | |
| 1228 | 1228 | static int mov_write_mdhd_tag(AVIOContext *pb, MOVTrack *track) |
| 1229 | 1229 | { |
| 1230 | | − int version = track->trackDuration < INT32_MAX ? 0 : 1; |
| 1230 | + int version = track->track_duration < INT32_MAX ? 0 : 1; |
| 1231 | 1231 | |
| 1232 | 1232 | (version == 1) ? avio_wb32(pb, 44) : avio_wb32(pb, 32); /* size */ |
| 1233 | 1233 | ffio_wfourcc(pb, "mdhd"); |
| @@ -1241,7 +1241,7 @@ static int mov_write_mdhd_tag(AVIOContext *pb, MOVTrack *track) · 7 unmodified lines |
| 1241 | 1241 | avio_wb32(pb, track->time); /* modification time */ |
| 1242 | 1242 | } |
| 1243 | 1243 | avio_wb32(pb, track->timescale); /* time scale (sample rate for audio) */ |
| 1244 | | − (version == 1) ? avio_wb64(pb, track->trackDuration) : avio_wb32(pb, track->trackDuration); /* duration */ |
| 1244 | + (version == 1) ? avio_wb64(pb, track->track_duration) : avio_wb32(pb, track->track_duration); /* duration */ |
| 1245 | 1245 | avio_wb16(pb, track->language); /* language */ |
| 1246 | 1246 | avio_wb16(pb, 0); /* reserved (quality) */ |
| 1247 | 1247 | |
| @@ -1263,12 +1263,12 @@ static int mov_write_mdia_tag(AVIOContext *pb, MOVTrack *track) · 15 unmodified lines |
| 1263 | 1263 | mov_write_mdhd_tag(pb, track); |
| 1264 | 1264 | mov_write_hdlr_tag(pb, track); |
| 1265 | 1265 | mov_write_minf_tag(pb, track); |
| 1266 | | − return updateSize(pb, pos); |
| 1266 | + return update_size(pb, pos); |
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | 1269 | static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st) |
| 1270 | 1270 | { |
| 1271 | | − int64_t duration = av_rescale_rnd(track->trackDuration, MOV_TIMESCALE, |
| 1271 | + int64_t duration = av_rescale_rnd(track->track_duration, MOV_TIMESCALE, |
| 1272 | 1272 | track->timescale, AV_ROUND_UP); |
| 1273 | 1273 | int version = duration < INT32_MAX ? 0 : 1; |
| 1274 | 1274 | |
| @@ -1283,7 +1283,7 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st) · 8 unmodified lines |
| 1283 | 1283 | avio_wb32(pb, track->time); /* creation time */ |
| 1284 | 1284 | avio_wb32(pb, track->time); /* modification time */ |
| 1285 | 1285 | } |
| 1286 | | − avio_wb32(pb, track->trackID); /* track-id */ |
| 1286 | + avio_wb32(pb, track->track_id); /* track-id */ |
| 1287 | 1287 | avio_wb32(pb, 0); /* reserved */ |
| 1288 | 1288 | (version == 1) ? avio_wb64(pb, duration) : avio_wb32(pb, duration); |
| 1289 | 1289 | |
| @@ -1352,13 +1352,13 @@ static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track) · 62 unmodified lines |
| 1352 | 1352 | avio_wb32(pb, track->enc->width << 16); |
| 1353 | 1353 | avio_wb32(pb, track->enc->height << 16); |
| 1354 | 1354 | |
| 1355 | | − return updateSize(pb, pos); |
| 1355 | + return update_size(pb, pos); |
| 1356 | 1356 | } |
| 1357 | 1357 | |
| 1358 | 1358 | // This box seems important for the psp playback ... without it the movie seems to hang |
| 1359 | 1359 | static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track) |
| 1360 | 1360 | { |
| 1361 | | − int64_t duration = av_rescale_rnd(track->trackDuration, MOV_TIMESCALE, |
| 1361 | + int64_t duration = av_rescale_rnd(track->track_duration, MOV_TIMESCALE, |
| 1362 | 1362 | track->timescale, AV_ROUND_UP); |
| 1363 | 1363 | int version = duration < INT32_MAX ? 0 : 1; |
| 1364 | 1364 | int entry_size, entry_count, size; |
| @@ -1466,13 +1466,13 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov, · 101 unmodified lines |
| 1466 | 1466 | if (track->mode == MODE_PSP) |
| 1467 | 1467 | mov_write_uuid_tag_psp(pb,track); // PSP Movies require this uuid box |
| 1468 | 1468 | if (track->tag == MKTAG('r','t','p',' ')) |
| 1469 | | − mov_write_udta_sdp(pb, track->rtp_ctx, track->trackID); |
| 1469 | + mov_write_udta_sdp(pb, track->rtp_ctx, track->track_id); |
| 1470 | 1470 | if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && track->mode == MODE_MOV) { |
| 1471 | 1471 | double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio); |
| 1472 | 1472 | if (0.0 != sample_aspect_ratio && 1.0 != sample_aspect_ratio) |
| 1473 | 1473 | mov_write_tapt_tag(pb, track); |
| 1474 | 1474 | }; |
| 1475 | | − return updateSize(pb, pos); |
| 1475 | + return update_size(pb, pos); |
| 1476 | 1476 | } |
| 1477 | 1477 | |
| 1478 | 1478 | static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov) |
| @@ -1494,14 +1494,14 @@ static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov) · 15 unmodified lines |
| 1494 | 1494 | avio_wb32(pb, 0x0); /* size */ |
| 1495 | 1495 | ffio_wfourcc(pb, "iods"); |
| 1496 | 1496 | avio_wb32(pb, 0); /* version & flags */ |
| 1497 | | − putDescr(pb, 0x10, 7); |
| 1497 | + put_descr(pb, 0x10, 7); |
| 1498 | 1498 | avio_wb16(pb, 0x004f); |
| 1499 | 1499 | avio_w8(pb, 0xff); |
| 1500 | 1500 | avio_w8(pb, 0xff); |
| 1501 | 1501 | avio_w8(pb, audio_profile); |
| 1502 | 1502 | avio_w8(pb, video_profile); |
| 1503 | 1503 | avio_w8(pb, 0xff); |
| 1504 | | − return updateSize(pb, pos); |
| 1504 | + return update_size(pb, pos); |
| 1505 | 1505 | } |
| 1506 | 1506 | |
| 1507 | 1507 | static int mov_write_trex_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -1509,7 +1509,7 @@ static int mov_write_trex_tag(AVIOContext *pb, MOVTrack *track) · 1 unmodified line |
| 1509 | 1509 | avio_wb32(pb, 0x20); /* size */ |
| 1510 | 1510 | ffio_wfourcc(pb, "trex"); |
| 1511 | 1511 | avio_wb32(pb, 0); /* version & flags */ |
| 1512 | | − avio_wb32(pb, track->trackID); /* track ID */ |
| 1512 | + avio_wb32(pb, track->track_id); /* track ID */ |
| 1513 | 1513 | avio_wb32(pb, 1); /* default sample description index */ |
| 1514 | 1514 | avio_wb32(pb, 0); /* default sample duration */ |
| 1515 | 1515 | avio_wb32(pb, 0); /* default sample size */ |
| @@ -1525,29 +1525,29 @@ static int mov_write_mvex_tag(AVIOContext *pb, MOVMuxContext *mov) · 9 unmodified lines |
| 1525 | 1525 | ffio_wfourcc(pb, "mvex"); |
| 1526 | 1526 | for (i = 0; i < mov->nb_streams; i++) |
| 1527 | 1527 | mov_write_trex_tag(pb, &mov->tracks[i]); |
| 1528 | | − return updateSize(pb, pos); |
| 1528 | + return update_size(pb, pos); |
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov) |
| 1532 | 1532 | { |
| 1533 | | − int maxTrackID = 1, i; |
| 1534 | | − int64_t maxTrackLenTemp, maxTrackLen = 0; |
| 1533 | + int max_track_id = 1, i; |
| 1534 | + int64_t max_track_len_temp, max_track_len = 0; |
| 1535 | 1535 | int version; |
| 1536 | 1536 | |
| 1537 | 1537 | for (i=0; i<mov->nb_streams; i++) { |
| 1538 | 1538 | if(mov->tracks[i].entry > 0) { |
| 1539 | | − maxTrackLenTemp = av_rescale_rnd(mov->tracks[i].trackDuration, |
| 1540 | | − MOV_TIMESCALE, |
| 1541 | | − mov->tracks[i].timescale, |
| 1542 | | − AV_ROUND_UP); |
| 1543 | | − if(maxTrackLen < maxTrackLenTemp) |
| 1544 | | − maxTrackLen = maxTrackLenTemp; |
| 1545 | | − if(maxTrackID < mov->tracks[i].trackID) |
| 1546 | | − maxTrackID = mov->tracks[i].trackID; |
| 1539 | + max_track_len_temp = av_rescale_rnd(mov->tracks[i].track_duration, |
| 1540 | + MOV_TIMESCALE, |
| 1541 | + mov->tracks[i].timescale, |
| 1542 | + AV_ROUND_UP); |
| 1543 | + if (max_track_len < max_track_len_temp) |
| 1544 | + max_track_len = max_track_len_temp; |
| 1545 | + if (max_track_id < mov->tracks[i].track_id) |
| 1546 | + max_track_id = mov->tracks[i].track_id; |
| 1547 | 1547 | } |
| 1548 | 1548 | } |
| 1549 | 1549 | |
| 1550 | | − version = maxTrackLen < UINT32_MAX ? 0 : 1; |
| 1550 | + version = max_track_len < UINT32_MAX ? 0 : 1; |
| 1551 | 1551 | (version == 1) ? avio_wb32(pb, 120) : avio_wb32(pb, 108); /* size */ |
| 1552 | 1552 | ffio_wfourcc(pb, "mvhd"); |
| 1553 | 1553 | avio_w8(pb, version); |
| @@ -1560,7 +1560,7 @@ static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov) · 6 unmodified lines |
| 1560 | 1560 | avio_wb32(pb, mov->time); /* modification time */ |
| 1561 | 1561 | } |
| 1562 | 1562 | avio_wb32(pb, MOV_TIMESCALE); |
| 1563 | | − (version == 1) ? avio_wb64(pb, maxTrackLen) : avio_wb32(pb, maxTrackLen); /* duration of longest track */ |
| 1563 | + (version == 1) ? avio_wb64(pb, max_track_len) : avio_wb32(pb, max_track_len); /* duration of longest track */ |
| 1564 | 1564 | |
| 1565 | 1565 | avio_wb32(pb, 0x00010000); /* reserved (preferred rate) 1.0 = normal */ |
| 1566 | 1566 | avio_wb16(pb, 0x0100); /* reserved (preferred volume) 1.0 = normal */ |
| @@ -1585,7 +1585,7 @@ static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov) · 18 unmodified lines |
| 1585 | 1585 | avio_wb32(pb, 0); /* reserved (selection time) */ |
| 1586 | 1586 | avio_wb32(pb, 0); /* reserved (selection duration) */ |
| 1587 | 1587 | avio_wb32(pb, 0); /* reserved (current time) */ |
| 1588 | | − avio_wb32(pb, maxTrackID+1); /* Next track id */ |
| 1588 | + avio_wb32(pb, max_track_id + 1); /* Next track id */ |
| 1589 | 1589 | return 0x6c; |
| 1590 | 1590 | } |
| 1591 | 1591 | |
| @@ -1632,7 +1632,7 @@ static int mov_write_string_tag(AVIOContext *pb, const char *name, const char *v · 40 unmodified lines |
| 1632 | 1632 | avio_wb32(pb, 0); /* size */ |
| 1633 | 1633 | ffio_wfourcc(pb, name); |
| 1634 | 1634 | mov_write_string_data_tag(pb, value, lang, long_style); |
| 1635 | | − size= updateSize(pb, pos); |
| 1635 | + size = update_size(pb, pos); |
| 1636 | 1636 | } |
| 1637 | 1637 | return size; |
| 1638 | 1638 | } |
| @@ -1708,7 +1708,7 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, · 69 unmodified lines |
| 1708 | 1708 | mov_write_string_metadata(s, pb, "tven", "episode_id",1); |
| 1709 | 1709 | mov_write_string_metadata(s, pb, "tvnn", "network" , 1); |
| 1710 | 1710 | mov_write_trkn_tag(pb, mov, s); |
| 1711 | | − return updateSize(pb, pos); |
| 1711 | + return update_size(pb, pos); |
| 1712 | 1712 | } |
| 1713 | 1713 | |
| 1714 | 1714 | /* iTunes meta data tag */ |
| @@ -1722,7 +1722,7 @@ static int mov_write_meta_tag(AVIOContext *pb, MOVMuxContext *mov, · 7 unmodified lines |
| 1722 | 1722 | avio_wb32(pb, 0); |
| 1723 | 1723 | mov_write_itunes_hdlr_tag(pb, mov, s); |
| 1724 | 1724 | mov_write_ilst_tag(pb, mov, s); |
| 1725 | | − size = updateSize(pb, pos); |
| 1725 | + size = update_size(pb, pos); |
| 1726 | 1726 | return size; |
| 1727 | 1727 | } |
| 1728 | 1728 | |
| @@ -1772,7 +1772,7 @@ static int mov_write_3gp_udta_tag(AVIOContext *pb, AVFormatContext *s, · 43 unmodified lines |
| 1772 | 1772 | (t = av_dict_get(s->metadata, "track", NULL, 0))) |
| 1773 | 1773 | avio_w8(pb, atoi(t->value)); |
| 1774 | 1774 | } |
| 1775 | | − return updateSize(pb, pos); |
| 1775 | + return update_size(pb, pos); |
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | 1778 | static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s) |
| @@ -1798,7 +1798,7 @@ static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s) · 19 unmodified lines |
| 1798 | 1798 | } else |
| 1799 | 1799 | avio_w8(pb, 0); |
| 1800 | 1800 | } |
| 1801 | | − return updateSize(pb, pos); |
| 1801 | + return update_size(pb, pos); |
| 1802 | 1802 | } |
| 1803 | 1803 | |
| 1804 | 1804 | static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, |
| @@ -1898,8 +1898,8 @@ static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s) · 93 unmodified lines |
| 1898 | 1898 | // snprintf(dt,32,"%04d/%02d/%02d %02d:%02d:%02d",t_st->tm_year+1900,t_st->tm_mon+1,t_st->tm_mday,t_st->tm_hour,t_st->tm_min,t_st->tm_sec); |
| 1899 | 1899 | mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03); |
| 1900 | 1900 | |
| 1901 | | − updateSize(pb, pos2); |
| 1902 | | − return updateSize(pb, pos); |
| 1901 | + update_size(pb, pos2); |
| 1902 | + return update_size(pb, pos); |
| 1903 | 1903 | } |
| 1904 | 1904 | |
| 1905 | 1905 | return 0; |
| @@ -1916,7 +1916,7 @@ static void build_chunks(MOVTrack *trk) · 10 unmodified lines |
| 1916 | 1916 | if(chunk->pos + chunkSize == trk->cluster[i].pos && |
| 1917 | 1917 | chunkSize + trk->cluster[i].size < (1<<20)){ |
| 1918 | 1918 | chunkSize += trk->cluster[i].size; |
| 1919 | | − chunk->samplesInChunk += trk->cluster[i].entries; |
| 1919 | + chunk->samples_in_chunk += trk->cluster[i].entries; |
| 1920 | 1920 | }else{ |
| 1921 | 1921 | trk->cluster[i].chunkNum = chunk->chunkNum+1; |
| 1922 | 1922 | chunk=&trk->cluster[i]; |
| @@ -1939,7 +1939,7 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, · 16 unmodified lines |
| 1939 | 1939 | continue; |
| 1940 | 1940 | |
| 1941 | 1941 | mov->tracks[i].time = mov->time; |
| 1942 | | − mov->tracks[i].trackID = i+1; |
| 1942 | + mov->tracks[i].track_id = i+1; |
| 1943 | 1943 | |
| 1944 | 1944 | build_chunks(&mov->tracks[i]); |
| 1945 | 1945 | } |
| @@ -1947,13 +1947,13 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, · 1 unmodified line |
| 1947 | 1947 | if (mov->chapter_track) |
| 1948 | 1948 | for (i=0; i<s->nb_streams; i++) { |
| 1949 | 1949 | mov->tracks[i].tref_tag = MKTAG('c','h','a','p'); |
| 1950 | | − mov->tracks[i].tref_id = mov->tracks[mov->chapter_track].trackID; |
| 1950 | + mov->tracks[i].tref_id = mov->tracks[mov->chapter_track].track_id; |
| 1951 | 1951 | } |
| 1952 | 1952 | for (i = 0; i < mov->nb_streams; i++) { |
| 1953 | 1953 | if (mov->tracks[i].tag == MKTAG('r','t','p',' ')) { |
| 1954 | 1954 | mov->tracks[i].tref_tag = MKTAG('h','i','n','t'); |
| 1955 | 1955 | mov->tracks[i].tref_id = |
| 1956 | | − mov->tracks[mov->tracks[i].src_track].trackID; |
| 1956 | + mov->tracks[mov->tracks[i].src_track].track_id; |
| 1957 | 1957 | } |
| 1958 | 1958 | } |
| 1959 | 1959 | |
| @@ -1973,7 +1973,7 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, · 13 unmodified lines |
| 1973 | 1973 | else |
| 1974 | 1974 | mov_write_udta_tag(pb, mov, s); |
| 1975 | 1975 | |
| 1976 | | − return updateSize(pb, pos); |
| 1976 | + return update_size(pb, pos); |
| 1977 | 1977 | } |
| 1978 | 1978 | |
| 1979 | 1979 | static void param_write_int(AVIOContext *pb, const char *name, int value) |
| @@ -2040,7 +2040,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov) · 60 unmodified lines |
| 2040 | 2040 | for (i = 0; i < mov->nb_streams; i++) { |
| 2041 | 2041 | MOVTrack *track = &mov->tracks[i]; |
| 2042 | 2042 | const char *type; |
| 2043 | | − /* track->trackID is initialized in write_moov, and thus isn't known |
| 2043 | + /* track->track_id is initialized in write_moov, and thus isn't known |
| 2044 | 2044 | * here yet */ |
| 2045 | 2045 | int track_id = i + 1; |
| 2046 | 2046 | |
| @@ -2095,7 +2095,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov) · 48 unmodified lines |
| 2095 | 2095 | avio_printf(pb, "</body>\n"); |
| 2096 | 2096 | avio_printf(pb, "</smil>\n"); |
| 2097 | 2097 | |
| 2098 | | − return updateSize(pb, pos); |
| 2098 | + return update_size(pb, pos); |
| 2099 | 2099 | } |
| 2100 | 2100 | |
| 2101 | 2101 | static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov) |
| @@ -2129,7 +2129,7 @@ static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track, · 27 unmodified lines |
| 2129 | 2129 | avio_w8(pb, 0); /* version */ |
| 2130 | 2130 | avio_wb24(pb, flags); |
| 2131 | 2131 | |
| 2132 | | − avio_wb32(pb, track->trackID); /* track-id */ |
| 2132 | + avio_wb32(pb, track->track_id); /* track-id */ |
| 2133 | 2133 | if (flags & 0x01) |
| 2134 | 2134 | avio_wb64(pb, moof_offset); |
| 2135 | 2135 | if (flags & 0x08) { |
| @@ -2149,7 +2149,7 @@ static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track, · 13 unmodified lines |
| 2149 | 2149 | avio_wb32(pb, track->default_sample_flags); |
| 2150 | 2150 | } |
| 2151 | 2151 | |
| 2152 | | − return updateSize(pb, pos); |
| 2152 | + return update_size(pb, pos); |
| 2153 | 2153 | } |
| 2154 | 2154 | |
| 2155 | 2155 | static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry) |
| @@ -2165,7 +2165,7 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track) · 9 unmodified lines |
| 2165 | 2165 | |
| 2166 | 2166 | for (i = 0; i < track->entry; i++) { |
| 2167 | 2167 | int64_t duration = i + 1 == track->entry ? |
| 2168 | | − track->trackDuration - track->cluster[i].dts + track->start_dts : |
| 2168 | + track->track_duration - track->cluster[i].dts + track->start_dts : |
| 2169 | 2169 | track->cluster[i + 1].dts - track->cluster[i].dts; |
| 2170 | 2170 | if (duration != track->default_duration) |
| 2171 | 2171 | flags |= 0x100; /* sample-duration-present */ |
| @@ -2192,7 +2192,7 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track) · 20 unmodified lines |
| 2192 | 2192 | |
| 2193 | 2193 | for (i = 0; i < track->entry; i++) { |
| 2194 | 2194 | int64_t duration = i + 1 == track->entry ? |
| 2195 | | − track->trackDuration - track->cluster[i].dts + track->start_dts : |
| 2195 | + track->track_duration - track->cluster[i].dts + track->start_dts : |
| 2196 | 2196 | track->cluster[i + 1].dts - track->cluster[i].dts; |
| 2197 | 2197 | if (flags & 0x100) |
| 2198 | 2198 | avio_wb32(pb, duration); |
| @@ -2204,7 +2204,7 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track) · 5 unmodified lines |
| 2204 | 2204 | avio_wb32(pb, track->cluster[i].cts); |
| 2205 | 2205 | } |
| 2206 | 2206 | |
| 2207 | | − return updateSize(pb, pos); |
| 2207 | + return update_size(pb, pos); |
| 2208 | 2208 | } |
| 2209 | 2209 | |
| 2210 | 2210 | static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -2221,10 +2221,10 @@ static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track) · 10 unmodified lines |
| 2221 | 2221 | avio_w8(pb, 1); |
| 2222 | 2222 | avio_wb24(pb, 0); |
| 2223 | 2223 | avio_wb64(pb, track->frag_start); |
| 2224 | | − avio_wb64(pb, track->start_dts + track->trackDuration - |
| 2224 | + avio_wb64(pb, track->start_dts + track->track_duration - |
| 2225 | 2225 | track->cluster[0].dts); |
| 2226 | 2226 | |
| 2227 | | − return updateSize(pb, pos); |
| 2227 | + return update_size(pb, pos); |
| 2228 | 2228 | } |
| 2229 | 2229 | |
| 2230 | 2230 | static int mov_write_tfrf_tag(AVIOContext *pb, MOVMuxContext *mov, |
| @@ -2300,7 +2300,7 @@ static int mov_write_traf_tag(AVIOContext *pb, MOVMuxContext *mov, · 69 unmodified lines |
| 2300 | 2300 | } |
| 2301 | 2301 | } |
| 2302 | 2302 | |
| 2303 | | − return updateSize(pb, pos); |
| 2303 | + return update_size(pb, pos); |
| 2304 | 2304 | } |
| 2305 | 2305 | |
| 2306 | 2306 | static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks) |
| @@ -2334,7 +2334,7 @@ static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks) · 27 unmodified lines |
| 2334 | 2334 | } |
| 2335 | 2335 | avio_seek(pb, end, SEEK_SET); |
| 2336 | 2336 | |
| 2337 | | − return updateSize(pb, pos); |
| 2337 | + return update_size(pb, pos); |
| 2338 | 2338 | } |
| 2339 | 2339 | |
| 2340 | 2340 | static int mov_write_tfra_tag(AVIOContext *pb, MOVTrack *track) |
| @@ -2347,7 +2347,7 @@ static int mov_write_tfra_tag(AVIOContext *pb, MOVTrack *track) · 6 unmodified lines |
| 2347 | 2347 | avio_w8(pb, 1); /* version */ |
| 2348 | 2348 | avio_wb24(pb, 0); |
| 2349 | 2349 | |
| 2350 | | − avio_wb32(pb, track->trackID); |
| 2350 | + avio_wb32(pb, track->track_id); |
| 2351 | 2351 | avio_wb32(pb, 0); /* length of traf/trun/sample num */ |
| 2352 | 2352 | avio_wb32(pb, track->nb_frag_info); |
| 2353 | 2353 | for (i = 0; i < track->nb_frag_info; i++) { |
| @@ -2358,7 +2358,7 @@ static int mov_write_tfra_tag(AVIOContext *pb, MOVTrack *track) · 4 unmodified lines |
| 2358 | 2358 | avio_w8(pb, 1); /* sample number */ |
| 2359 | 2359 | } |
| 2360 | 2360 | |
| 2361 | | − return updateSize(pb, pos); |
| 2361 | + return update_size(pb, pos); |
| 2362 | 2362 | } |
| 2363 | 2363 | |
| 2364 | 2364 | static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov) |
| @@ -2371,7 +2371,7 @@ static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov) · 6 unmodified lines |
| 2371 | 2371 | /* An empty mfra atom is enough to indicate to the publishing point that |
| 2372 | 2372 | * the stream has ended. */ |
| 2373 | 2373 | if (mov->flags & FF_MOV_FLAG_ISML) |
| 2374 | | − return updateSize(pb, pos); |
| 2374 | + return update_size(pb, pos); |
| 2375 | 2375 | |
| 2376 | 2376 | for (i = 0; i < mov->nb_streams; i++) { |
| 2377 | 2377 | MOVTrack *track = &mov->tracks[i]; |
| @@ -2384,7 +2384,7 @@ static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov) · 6 unmodified lines |
| 2384 | 2384 | avio_wb32(pb, 0); /* version + flags */ |
| 2385 | 2385 | avio_wb32(pb, avio_tell(pb) + 4 - pos); |
| 2386 | 2386 | |
| 2387 | | − return updateSize(pb, pos); |
| 2387 | + return update_size(pb, pos); |
| 2388 | 2388 | } |
| 2389 | 2389 | |
| 2390 | 2390 | static int mov_write_mdat_tag(AVIOContext *pb, MOVMuxContext *mov) |
| @@ -2457,17 +2457,17 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s) · 66 unmodified lines |
| 2457 | 2457 | ffio_wfourcc(pb, "MSNV"); |
| 2458 | 2458 | else if (mov->mode == MODE_MP4) |
| 2459 | 2459 | ffio_wfourcc(pb, "mp41"); |
| 2460 | | − return updateSize(pb, pos); |
| 2460 | + return update_size(pb, pos); |
| 2461 | 2461 | } |
| 2462 | 2462 | |
| 2463 | 2463 | static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s) |
| 2464 | 2464 | { |
| 2465 | | − AVCodecContext *VideoCodec = s->streams[0]->codec; |
| 2466 | | − AVCodecContext *AudioCodec = s->streams[1]->codec; |
| 2467 | | − int AudioRate = AudioCodec->sample_rate; |
| 2468 | | − int FrameRate = ((VideoCodec->time_base.den) * (0x10000))/ (VideoCodec->time_base.num); |
| 2469 | | − int audio_kbitrate= AudioCodec->bit_rate / 1000; |
| 2470 | | − int video_kbitrate= FFMIN(VideoCodec->bit_rate / 1000, 800 - audio_kbitrate); |
| 2465 | + AVCodecContext *video_codec = s->streams[0]->codec; |
| 2466 | + AVCodecContext *audio_codec = s->streams[1]->codec; |
| 2467 | + int audio_rate = audio_codec->sample_rate; |
| 2468 | + int frame_rate = ((video_codec->time_base.den) * (0x10000))/ (video_codec->time_base.num); |
| 2469 | + int audio_kbitrate = audio_codec->bit_rate / 1000; |
| 2470 | + int video_kbitrate = FFMIN(video_codec->bit_rate / 1000, 800 - audio_kbitrate); |
| 2471 | 2471 | |
| 2472 | 2472 | avio_wb32(pb, 0x94); /* size */ |
| 2473 | 2473 | ffio_wfourcc(pb, "uuid"); |
| @@ -2495,14 +2495,14 @@ static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s) · 21 unmodified lines |
| 2495 | 2495 | avio_wb32(pb, 0x0); |
| 2496 | 2496 | avio_wb32(pb, audio_kbitrate); |
| 2497 | 2497 | avio_wb32(pb, audio_kbitrate); |
| 2498 | | − avio_wb32(pb, AudioRate); |
| 2499 | | − avio_wb32(pb, AudioCodec->channels); |
| 2498 | + avio_wb32(pb, audio_rate); |
| 2499 | + avio_wb32(pb, audio_codec->channels); |
| 2500 | 2500 | |
| 2501 | 2501 | avio_wb32(pb, 0x34); /* size */ |
| 2502 | 2502 | ffio_wfourcc(pb, "VPRF"); /* video */ |
| 2503 | 2503 | avio_wb32(pb, 0x0); |
| 2504 | 2504 | avio_wb32(pb, 0x1); /* TrackID */ |
| 2505 | | − if (VideoCodec->codec_id == CODEC_ID_H264) { |
| 2505 | + if (video_codec->codec_id == CODEC_ID_H264) { |
| 2506 | 2506 | ffio_wfourcc(pb, "avc1"); |
| 2507 | 2507 | avio_wb16(pb, 0x014D); |
| 2508 | 2508 | avio_wb16(pb, 0x0015); |
| @@ -2514,10 +2514,10 @@ static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s) · 5 unmodified lines |
| 2514 | 2514 | avio_wb32(pb, 0x0); |
| 2515 | 2515 | avio_wb32(pb, video_kbitrate); |
| 2516 | 2516 | avio_wb32(pb, video_kbitrate); |
| 2517 | | − avio_wb32(pb, FrameRate); |
| 2518 | | − avio_wb32(pb, FrameRate); |
| 2519 | | − avio_wb16(pb, VideoCodec->width); |
| 2520 | | − avio_wb16(pb, VideoCodec->height); |
| 2517 | + avio_wb32(pb, frame_rate); |
| 2518 | + avio_wb32(pb, frame_rate); |
| 2519 | + avio_wb16(pb, video_codec->width); |
| 2520 | + avio_wb16(pb, video_codec->height); |
| 2521 | 2521 | avio_wb32(pb, 0x010001); /* ? */ |
| 2522 | 2522 | } |
| 2523 | 2523 | |
| @@ -2569,7 +2569,7 @@ static int mov_flush_fragment(AVFormatContext *s) · 45 unmodified lines |
| 2569 | 2569 | for (i = 0; i < mov->nb_streams; i++) { |
| 2570 | 2570 | if (mov->tracks[i].entry) |
| 2571 | 2571 | mov->tracks[i].frag_start += mov->tracks[i].start_dts + |
| 2572 | | − mov->tracks[i].trackDuration - |
| 2572 | + mov->tracks[i].track_duration - |
| 2573 | 2573 | mov->tracks[i].cluster[0].dts; |
| 2574 | 2574 | mov->tracks[i].entry = 0; |
| 2575 | 2575 | } |
| @@ -2600,7 +2600,7 @@ static int mov_flush_fragment(AVFormatContext *s) · 24 unmodified lines |
| 2600 | 2600 | int64_t duration = 0; |
| 2601 | 2601 | |
| 2602 | 2602 | if (track->entry) |
| 2603 | | − duration = track->start_dts + track->trackDuration - |
| 2603 | + duration = track->start_dts + track->track_duration - |
| 2604 | 2604 | track->cluster[0].dts; |
| 2605 | 2605 | if (mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) { |
| 2606 | 2606 | if (!track->mdat_buf) |
| @@ -2656,7 +2656,7 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) · 49 unmodified lines |
| 2656 | 2656 | AVIOContext *pb = s->pb; |
| 2657 | 2657 | MOVTrack *trk = &mov->tracks[pkt->stream_index]; |
| 2658 | 2658 | AVCodecContext *enc = trk->enc; |
| 2659 | | − unsigned int samplesInChunk = 0; |
| 2659 | + unsigned int samples_in_chunk = 0; |
| 2660 | 2660 | int size= pkt->size; |
| 2661 | 2661 | uint8_t *reformatted_data = NULL; |
| 2662 | 2662 | |
| @@ -2691,30 +2691,30 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) · 28 unmodified lines |
| 2691 | 2691 | {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1}; |
| 2692 | 2692 | int len = 0; |
| 2693 | 2693 | |
| 2694 | | − while (len < size && samplesInChunk < 100) { |
| 2694 | + while (len < size && samples_in_chunk < 100) { |
| 2695 | 2695 | len += packed_size[(pkt->data[len] >> 3) & 0x0F]; |
| 2696 | | − samplesInChunk++; |
| 2696 | + samples_in_chunk++; |
| 2697 | 2697 | } |
| 2698 | | − if(samplesInChunk > 1){ |
| 2698 | + if (samples_in_chunk > 1) { |
| 2699 | 2699 | av_log(s, AV_LOG_ERROR, "fatal error, input is not a single packet, implement a AVParser for it\n"); |
| 2700 | 2700 | return -1; |
| 2701 | 2701 | } |
| 2702 | 2702 | } else if (enc->codec_id == CODEC_ID_ADPCM_MS || |
| 2703 | 2703 | enc->codec_id == CODEC_ID_ADPCM_IMA_WAV) { |
| 2704 | | − samplesInChunk = enc->frame_size; |
| 2705 | | − } else if (trk->sampleSize) |
| 2706 | | − samplesInChunk = size/trk->sampleSize; |
| 2704 | + samples_in_chunk = enc->frame_size; |
| 2705 | + } else if (trk->sample_size) |
| 2706 | + samples_in_chunk = size / trk->sample_size; |
| 2707 | 2707 | else |
| 2708 | | − samplesInChunk = 1; |
| 2708 | + samples_in_chunk = 1; |
| 2709 | 2709 | |
| 2710 | 2710 | /* copy extradata if it exists */ |
| 2711 | | − if (trk->vosLen == 0 && enc->extradata_size > 0) { |
| 2712 | | − trk->vosLen = enc->extradata_size; |
| 2713 | | − trk->vosData = av_malloc(trk->vosLen); |
| 2714 | | − memcpy(trk->vosData, enc->extradata, trk->vosLen); |
| 2711 | + if (trk->vos_len == 0 && enc->extradata_size > 0) { |
| 2712 | + trk->vos_len = enc->extradata_size; |
| 2713 | + trk->vos_data = av_malloc(trk->vos_len); |
| 2714 | + memcpy(trk->vos_data, enc->extradata, trk->vos_len); |
| 2715 | 2715 | } |
| 2716 | 2716 | |
| 2717 | | − if (enc->codec_id == CODEC_ID_H264 && trk->vosLen > 0 && *(uint8_t *)trk->vosData != 1) { |
| 2717 | + if (enc->codec_id == CODEC_ID_H264 && trk->vos_len > 0 && *(uint8_t *)trk->vos_data != 1) { |
| 2718 | 2718 | /* from x264 or from bytestream h264 */ |
| 2719 | 2719 | /* nal reformating needed */ |
| 2720 | 2720 | if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) { |
| @@ -2733,13 +2733,13 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) · 12 unmodified lines |
| 2733 | 2733 | } |
| 2734 | 2734 | |
| 2735 | 2735 | if ((enc->codec_id == CODEC_ID_DNXHD || |
| 2736 | | − enc->codec_id == CODEC_ID_AC3) && !trk->vosLen) { |
| 2736 | + enc->codec_id == CODEC_ID_AC3) && !trk->vos_len) { |
| 2737 | 2737 | /* copy frame to create needed atoms */ |
| 2738 | | − trk->vosLen = size; |
| 2739 | | − trk->vosData = av_malloc(size); |
| 2740 | | − if (!trk->vosData) |
| 2738 | + trk->vos_len = size; |
| 2739 | + trk->vos_data = av_malloc(size); |
| 2740 | + if (!trk->vos_data) |
| 2741 | 2741 | return AVERROR(ENOMEM); |
| 2742 | | − memcpy(trk->vosData, pkt->data, size); |
| 2742 | + memcpy(trk->vos_data, pkt->data, size); |
| 2743 | 2743 | } |
| 2744 | 2744 | |
| 2745 | 2745 | if (!(trk->entry % MOV_INDEX_CLUSTER_SIZE)) { |
| @@ -2749,21 +2749,21 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) · 3 unmodified lines |
| 2749 | 2749 | } |
| 2750 | 2750 | |
| 2751 | 2751 | trk->cluster[trk->entry].pos = avio_tell(pb) - size; |
| 2752 | | − trk->cluster[trk->entry].samplesInChunk = samplesInChunk; |
| 2752 | + trk->cluster[trk->entry].samples_in_chunk = samples_in_chunk; |
| 2753 | 2753 | trk->cluster[trk->entry].chunkNum = 0; |
| 2754 | 2754 | trk->cluster[trk->entry].size = size; |
| 2755 | | − trk->cluster[trk->entry].entries = samplesInChunk; |
| 2755 | + trk->cluster[trk->entry].entries = samples_in_chunk; |
| 2756 | 2756 | trk->cluster[trk->entry].dts = pkt->dts; |
| 2757 | 2757 | if (!trk->entry && trk->start_dts != AV_NOPTS_VALUE) { |
| 2758 | 2758 | /* First packet of a new fragment. We already wrote the duration |
| 2759 | | − * of the last packet of the previous fragment based on trackDuration, |
| 2759 | + * of the last packet of the previous fragment based on track_duration, |
| 2760 | 2760 | * which might not exactly match our dts. Therefore adjust the dts |
| 2761 | 2761 | * of this packet to be what the previous packets duration implies. */ |
| 2762 | | − trk->cluster[trk->entry].dts = trk->start_dts + trk->trackDuration; |
| 2762 | + trk->cluster[trk->entry].dts = trk->start_dts + trk->track_duration; |
| 2763 | 2763 | } |
| 2764 | 2764 | if (trk->start_dts == AV_NOPTS_VALUE) |
| 2765 | 2765 | trk->start_dts = pkt->dts; |
| 2766 | | − trk->trackDuration = pkt->dts - trk->start_dts + pkt->duration; |
| 2766 | + trk->track_duration = pkt->dts - trk->start_dts + pkt->duration; |
| 2767 | 2767 | |
| 2768 | 2768 | if (pkt->pts == AV_NOPTS_VALUE) { |
| 2769 | 2769 | av_log(s, AV_LOG_WARNING, "pts has no value\n"); |
| @@ -2783,10 +2783,10 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) · 13 unmodified lines |
| 2783 | 2783 | trk->cluster[trk->entry].flags = MOV_SYNC_SAMPLE; |
| 2784 | 2784 | } |
| 2785 | 2785 | if (trk->cluster[trk->entry].flags & MOV_SYNC_SAMPLE) |
| 2786 | | − trk->hasKeyframes++; |
| 2786 | + trk->has_keyframes++; |
| 2787 | 2787 | } |
| 2788 | 2788 | trk->entry++; |
| 2789 | | − trk->sampleCount += samplesInChunk; |
| 2789 | + trk->sample_count += samples_in_chunk; |
| 2790 | 2790 | mov->mdat_size += size; |
| 2791 | 2791 | |
| 2792 | 2792 | avio_flush(pb); |
| @@ -2949,12 +2949,12 @@ static int mov_write_header(AVFormatContext *s) · 156 unmodified lines |
| 2949 | 2949 | av_log(s, AV_LOG_ERROR, "track %d: codec block align is not set for adpcm\n", i); |
| 2950 | 2950 | goto error; |
| 2951 | 2951 | } |
| 2952 | | − track->sampleSize = st->codec->block_align; |
| 2952 | + track->sample_size = st->codec->block_align; |
| 2953 | 2953 | }else if(st->codec->frame_size > 1){ /* assume compressed audio */ |
| 2954 | 2954 | track->audio_vbr = 1; |
| 2955 | 2955 | }else{ |
| 2956 | 2956 | st->codec->frame_size = 1; |
| 2957 | | − track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; |
| 2957 | + track->sample_size = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; |
| 2958 | 2958 | } |
| 2959 | 2959 | if (track->mode != MODE_MOV) { |
| 2960 | 2960 | if (track->timescale > UINT16_MAX) { |
| @@ -2982,9 +2982,9 @@ static int mov_write_header(AVFormatContext *s) · 21 unmodified lines |
| 2982 | 2982 | |
| 2983 | 2983 | /* copy extradata if it exists */ |
| 2984 | 2984 | if (st->codec->extradata_size) { |
| 2985 | | − track->vosLen = st->codec->extradata_size; |
| 2986 | | − track->vosData = av_malloc(track->vosLen); |
| 2987 | | − memcpy(track->vosData, st->codec->extradata, track->vosLen); |
| 2985 | + track->vos_len = st->codec->extradata_size; |
| 2986 | + track->vos_data = av_malloc(track->vos_len); |
| 2987 | + memcpy(track->vos_data, st->codec->extradata, track->vos_len); |
| 2988 | 2988 | } |
| 2989 | 2989 | } |
| 2990 | 2990 | |
| @@ -3101,7 +3101,8 @@ static int mov_write_trailer(AVFormatContext *s) · 110 unmodified lines |
| 3101 | 3101 | av_freep(&mov->tracks[i].cluster); |
| 3102 | 3102 | av_freep(&mov->tracks[i].frag_info); |
| 3103 | 3103 | |
| 3104 | | − if(mov->tracks[i].vosLen) av_free(mov->tracks[i].vosData); |
| 3104 | + if (mov->tracks[i].vos_len) |
| 3105 | + av_free(mov->tracks[i].vos_data); |
| 3105 | 3106 | |
| 3106 | 3107 | } |
| 3107 | 3108 | |