/*
* FLV muxer
- * Copyright (c) 2003 The FFmpeg Project
+ * Copyright (c) 2003 The Libav Project
*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
*
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
/* write meta_tag */
avio_w8(pb, 18); // tag type META
- metadata_size_pos= url_ftell(pb);
+ metadata_size_pos= avio_tell(pb);
avio_wb24(pb, 0); // size of data part (sum of all parts below)
avio_wb24(pb, 0); // time stamp
avio_wb32(pb, 0); // reserved
avio_wb32(pb, 5*!!video_enc + 5*!!audio_enc + 2); // +2 for duration and file size
put_amf_string(pb, "duration");
- flv->duration_offset= url_ftell(pb);
+ flv->duration_offset= avio_tell(pb);
put_amf_double(pb, s->duration / AV_TIME_BASE); // fill in the guessed duration, it'll be corrected later if incorrect
if(video_enc){
}
put_amf_string(pb, "filesize");
- flv->filesize_offset= url_ftell(pb);
+ flv->filesize_offset= avio_tell(pb);
put_amf_double(pb, 0); // delayed write
put_amf_string(pb, "");
avio_w8(pb, AMF_END_OF_OBJECT);
/* write total size of tag */
- data_size= url_ftell(pb) - metadata_size_pos - 10;
+ data_size= avio_tell(pb) - metadata_size_pos - 10;
avio_seek(pb, metadata_size_pos, SEEK_SET);
avio_wb24(pb, data_size);
- avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
+ avio_skip(pb, data_size + 10 - 3);
avio_wb32(pb, data_size + 11);
for (i = 0; i < s->nb_streams; i++) {
avio_wb24(pb, 0); // ts
avio_w8(pb, 0); // ts ext
avio_wb24(pb, 0); // streamid
- pos = url_ftell(pb);
+ pos = avio_tell(pb);
if (enc->codec_id == CODEC_ID_AAC) {
avio_w8(pb, get_audio_flags(enc));
avio_w8(pb, 0); // AAC sequence header
avio_wb24(pb, 0); // composition time
ff_isom_write_avcc(pb, enc->extradata, enc->extradata_size);
}
- data_size = url_ftell(pb) - pos;
+ data_size = avio_tell(pb) - pos;
avio_seek(pb, -data_size - 10, SEEK_CUR);
avio_wb24(pb, data_size);
- avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
+ avio_skip(pb, data_size + 10 - 3);
avio_wb32(pb, data_size + 11); // previous tag size
}
}
}
}
- file_size = url_ftell(pb);
+ file_size = avio_tell(pb);
/* update informations */
avio_seek(pb, flv->duration_offset, SEEK_SET);
avio_wb32(pb,size+flags_size+11); // previous tag size
flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration);
- put_flush_packet(pb);
+ avio_flush(pb);
av_free(data);