1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avio: rename put_flush_packet -> avio_flush

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
Anton Khirnov 2011-03-14 20:39:06 +01:00 committed by Ronald S. Bultje
parent 35f1023592
commit b7f2fdde74
47 changed files with 104 additions and 99 deletions

View File

@ -149,7 +149,7 @@ static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt)
break; break;
} }
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -132,7 +132,7 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
} }
} }
avio_write(pb, pkt->data, pkt->size); avio_write(pb, pkt->data, pkt->size);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -98,7 +98,7 @@ static int aiff_write_header(AVFormatContext *s)
av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate); av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
/* Data is starting here */ /* Data is starting here */
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -140,7 +140,7 @@ static int aiff_write_trailer(AVFormatContext *s)
/* return to the end */ /* return to the end */
avio_seek(pb, end_size, SEEK_SET); avio_seek(pb, end_size, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
} }
return 0; return 0;

View File

@ -50,14 +50,14 @@ static int amr_write_header(AVFormatContext *s)
{ {
return -1; return -1;
} }
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
static int amr_write_packet(AVFormatContext *s, AVPacket *pkt) static int amr_write_packet(AVFormatContext *s, AVPacket *pkt)
{ {
avio_write(s->pb, pkt->data, pkt->size); avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
#endif /* CONFIG_AMR_MUXER */ #endif /* CONFIG_AMR_MUXER */

View File

@ -574,7 +574,7 @@ static int asf_write_header(AVFormatContext *s)
return -1; return -1;
} }
put_flush_packet(s->pb); avio_flush(s->pb);
asf->packet_nb_payloads = 0; asf->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1; asf->packet_timestamp_start = -1;
@ -672,7 +672,7 @@ static void flush_packet(AVFormatContext *s)
avio_write(s->pb, asf->packet_buf, s->packet_size - packet_hdr_size); avio_write(s->pb, asf->packet_buf, s->packet_size - packet_hdr_size);
put_flush_packet(s->pb); avio_flush(s->pb);
asf->nb_packets++; asf->nb_packets++;
asf->packet_nb_payloads = 0; asf->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1; asf->packet_timestamp_start = -1;
@ -864,7 +864,7 @@ static int asf_write_trailer(AVFormatContext *s)
if ((!asf->is_streamed) && (asf->nb_index_count != 0)) { if ((!asf->is_streamed) && (asf->nb_index_count != 0)) {
asf_write_index(s, asf->index_ptr, asf->maximum_packet, asf->nb_index_count); asf_write_index(s, asf->index_ptr, asf->maximum_packet, asf->nb_index_count);
} }
put_flush_packet(s->pb); avio_flush(s->pb);
if (asf->is_streamed || url_is_streamed(s->pb)) { if (asf->is_streamed || url_is_streamed(s->pb)) {
put_chunk(s, 0x4524, 0, 0); /* end of stream */ put_chunk(s, 0x4524, 0, 0); /* end of stream */
@ -875,7 +875,7 @@ static int asf_write_trailer(AVFormatContext *s)
asf_write_header1(s, file_size, data_size - asf->data_offset); asf_write_header1(s, file_size, data_size - asf->data_offset);
} }
put_flush_packet(s->pb); avio_flush(s->pb);
av_free(asf->index_ptr); av_free(asf->index_ptr);
return 0; return 0;
} }

View File

@ -50,7 +50,7 @@ static int write_header(AVFormatContext *s)
last=p; last=p;
} }
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -59,7 +59,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
{ {
avio_write(s->pb, pkt->data, pkt->size); avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -72,7 +72,7 @@ static int write_trailer(AVFormatContext *s)
avio_write(s->pb, avctx->extradata + ass->extra_index, avio_write(s->pb, avctx->extradata + ass->extra_index,
avctx->extradata_size - ass->extra_index); avctx->extradata_size - ass->extra_index);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -74,7 +74,7 @@ static int au_write_header(AVFormatContext *s)
return -1; return -1;
} }
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -99,7 +99,7 @@ static int au_write_trailer(AVFormatContext *s)
avio_wb32(pb, (uint32_t)(file_size - 24)); avio_wb32(pb, (uint32_t)(file_size - 24));
avio_seek(pb, file_size, SEEK_SET); avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
} }
return 0; return 0;

View File

@ -393,7 +393,7 @@ static int avi_write_header(AVFormatContext *s)
avi->movi_list = ff_start_tag(pb, "LIST"); avi->movi_list = ff_start_tag(pb, "LIST");
ffio_wfourcc(pb, "movi"); ffio_wfourcc(pb, "movi");
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -438,7 +438,7 @@ static int avi_write_ix(AVFormatContext *s)
avio_wl32(pb, ((uint32_t)ie->len & ~0x80000000) | avio_wl32(pb, ((uint32_t)ie->len & ~0x80000000) |
(ie->flags & 0x10 ? 0 : 0x80000000)); (ie->flags & 0x10 ? 0 : 0x80000000));
} }
put_flush_packet(pb); avio_flush(pb);
pos = avio_tell(pb); pos = avio_tell(pb);
/* Updating one entry in the AVI OpenDML master index */ /* Updating one entry in the AVI OpenDML master index */
@ -578,7 +578,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
if (size & 1) if (size & 1)
avio_w8(pb, 0); avio_w8(pb, 0);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -624,7 +624,7 @@ static int avi_write_trailer(AVFormatContext *s)
avi_write_counters(s, avi->riff_id); avi_write_counters(s, avi->riff_id);
} }
} }
put_flush_packet(pb); avio_flush(pb);
for (i=0; i<s->nb_streams; i++) { for (i=0; i<s->nb_streams; i++) {
AVIStream *avist= s->streams[i]->priv_data; AVIStream *avist= s->streams[i]->priv_data;

View File

@ -435,6 +435,7 @@ attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __att
#else #else
attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...); attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
#endif #endif
attribute_deprecated void put_flush_packet(AVIOContext *s);
/** /**
* @} * @}
*/ */
@ -529,7 +530,7 @@ int avio_printf(AVIOContext *s, const char *fmt, ...);
attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size); attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
#endif #endif
void put_flush_packet(AVIOContext *s); void avio_flush(AVIOContext *s);
/** /**

View File

@ -170,7 +170,7 @@ void avio_write(AVIOContext *s, const unsigned char *buf, int size)
} }
} }
void put_flush_packet(AVIOContext *s) void avio_flush(AVIOContext *s)
{ {
flush_buffer(s); flush_buffer(s);
s->must_flush = 0; s->must_flush = 0;
@ -393,6 +393,10 @@ int url_fprintf(AVIOContext *s, const char *fmt, ...)
avio_write(s, buf, strlen(buf)); avio_write(s, buf, strlen(buf));
return ret; return ret;
} }
void put_flush_packet(AVIOContext *s)
{
avio_flush(s);
}
#endif #endif
int avio_put_str(AVIOContext *s, const char *str) int avio_put_str(AVIOContext *s, const char *str)
@ -1013,7 +1017,7 @@ int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags)
int url_close_buf(AVIOContext *s) int url_close_buf(AVIOContext *s)
{ {
put_flush_packet(s); avio_flush(s);
return s->buf_ptr - s->buffer; return s->buf_ptr - s->buffer;
} }
#endif #endif
@ -1141,7 +1145,7 @@ int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
padding = FF_INPUT_BUFFER_PADDING_SIZE; padding = FF_INPUT_BUFFER_PADDING_SIZE;
} }
put_flush_packet(s); avio_flush(s);
*pbuffer = d->buffer; *pbuffer = d->buffer;
size = d->size; size = d->size;

View File

@ -50,7 +50,7 @@ static int crc_write_trailer(struct AVFormatContext *s)
snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval); snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval);
avio_write(s->pb, buf, strlen(buf)); avio_write(s->pb, buf, strlen(buf));
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -60,7 +60,7 @@ static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
avio_wb16(s->pb, pkt->size); avio_wb16(s->pb, pkt->size);
avio_wb16(s->pb, 0x8010); // unknown avio_wb16(s->pb, 0x8010); // unknown
avio_write(s->pb, pkt->data, pkt->size); avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -382,7 +382,7 @@ static int dv_write_packet(struct AVFormatContext *s, AVPacket *pkt)
pkt->data, pkt->size, &frame); pkt->data, pkt->size, &frame);
if (fsize > 0) { if (fsize > 0) {
avio_write(s->pb, frame, fsize); avio_write(s->pb, frame, fsize);
put_flush_packet(s->pb); avio_flush(s->pb);
} }
return 0; return 0;
} }

View File

@ -44,7 +44,7 @@ static void flush_packet(AVFormatContext *s)
h |= 0x8000; h |= 0x8000;
avio_wb16(pb, h); avio_wb16(pb, h);
avio_write(pb, ffm->packet, ffm->packet_end - ffm->packet); avio_write(pb, ffm->packet, ffm->packet_end - ffm->packet);
put_flush_packet(pb); avio_flush(pb);
/* prepare next packet */ /* prepare next packet */
ffm->frame_offset = 0; /* no key frame */ ffm->frame_offset = 0; /* no key frame */
@ -187,7 +187,7 @@ static int ffm_write_header(AVFormatContext *s)
while ((avio_tell(pb) % ffm->packet_size) != 0) while ((avio_tell(pb) % ffm->packet_size) != 0)
avio_w8(pb, 0); avio_w8(pb, 0);
put_flush_packet(pb); avio_flush(pb);
/* init packet mux */ /* init packet mux */
ffm->packet_ptr = ffm->packet; ffm->packet_ptr = ffm->packet;
@ -235,7 +235,7 @@ static int ffm_write_trailer(AVFormatContext *s)
if (ffm->packet_ptr > ffm->packet) if (ffm->packet_ptr > ffm->packet)
flush_packet(s); flush_packet(s);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -53,7 +53,7 @@ static int write_header(AVFormatContext *s)
avio_write(s->pb, ID_STRING, sizeof(ID_STRING) - 1); avio_write(s->pb, ID_STRING, sizeof(ID_STRING) - 1);
avio_w8(s->pb, '1'); // version avio_w8(s->pb, '1'); // version
avio_w8(s->pb, '\n'); avio_w8(s->pb, '\n');
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -79,7 +79,7 @@ static int write_trailer(AVFormatContext *s)
write_tags(s->pb, ch->metadata); write_tags(s->pb, ch->metadata);
} }
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -67,7 +67,7 @@ static int write_trailer(AVFormatContext *s)
avio_wb16(pb, 1/av_q2d(st->codec->time_base)); avio_wb16(pb, 1/av_q2d(st->codec->time_base));
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
avio_w8(pb, 0x00); // reserved avio_w8(pb, 0x00); // reserved
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -104,7 +104,7 @@ static int flac_write_trailer(struct AVFormatContext *s)
avio_seek(pb, 8, SEEK_SET); avio_seek(pb, 8, SEEK_SET);
avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE); avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE);
avio_seek(pb, file_size, SEEK_SET); avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
} else { } else {
av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n"); av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
} }
@ -114,7 +114,7 @@ static int flac_write_trailer(struct AVFormatContext *s)
static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt) static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{ {
avio_write(s->pb, pkt->data, pkt->size); avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -430,7 +430,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_wb32(pb,size+flags_size+11); // previous tag size avio_wb32(pb,size+flags_size+11); // previous tag size
flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration); flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration);
put_flush_packet(pb); avio_flush(pb);
av_free(data); av_free(data);

View File

@ -29,7 +29,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
snprintf(buf, sizeof(buf), "%d, %"PRId64", %d, 0x%08x\n", pkt->stream_index, pkt->dts, pkt->size, crc); snprintf(buf, sizeof(buf), "%d, %"PRId64", %d, 0x%08x\n", pkt->stream_index, pkt->dts, pkt->size, crc);
avio_write(s->pb, buf, strlen(buf)); avio_write(s->pb, buf, strlen(buf));
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -287,7 +287,7 @@ static int gif_write_header(AVFormatContext *s)
gif_image_write_header(pb, width, height, loop_count, NULL); gif_image_write_header(pb, width, height, loop_count, NULL);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -322,7 +322,7 @@ static int gif_write_video(AVFormatContext *s,
gif_image_write_image(pb, 0, 0, enc->width, enc->height, gif_image_write_image(pb, 0, 0, enc->width, enc->height,
buf, enc->width * 3, PIX_FMT_RGB24); buf, enc->width * 3, PIX_FMT_RGB24);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -340,7 +340,7 @@ static int gif_write_trailer(AVFormatContext *s)
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
avio_w8(pb, 0x3b); avio_w8(pb, 0x3b);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -753,7 +753,7 @@ static int gxf_write_header(AVFormatContext *s)
gxf->packet_count = 3; gxf->packet_count = 3;
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -781,12 +781,12 @@ static int gxf_write_trailer(AVFormatContext *s)
gxf_write_map_packet(s, 1); gxf_write_map_packet(s, 1);
gxf_write_flt_packet(s); gxf_write_flt_packet(s);
gxf_write_umf_packet(s); gxf_write_umf_packet(s);
put_flush_packet(pb); avio_flush(pb);
/* update duration in all map packets */ /* update duration in all map packets */
for (i = 1; i < gxf->map_offsets_nb; i++) { for (i = 1; i < gxf->map_offsets_nb; i++) {
avio_seek(pb, gxf->map_offsets[i], SEEK_SET); avio_seek(pb, gxf->map_offsets[i], SEEK_SET);
gxf_write_map_packet(s, 1); gxf_write_map_packet(s, 1);
put_flush_packet(pb); avio_flush(pb);
} }
avio_seek(pb, end, SEEK_SET); avio_seek(pb, end, SEEK_SET);
@ -895,7 +895,7 @@ static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt)
gxf->packet_count = 0; gxf->packet_count = 0;
} }
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -30,7 +30,7 @@ static int roq_write_header(struct AVFormatContext *s)
}; };
avio_write(s->pb, header, 8); avio_write(s->pb, header, 8);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -372,8 +372,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
avio_write(pb[0], pkt->data , ysize); avio_write(pb[0], pkt->data , ysize);
avio_write(pb[1], pkt->data + ysize, (pkt->size - ysize)/2); avio_write(pb[1], pkt->data + ysize, (pkt->size - ysize)/2);
avio_write(pb[2], pkt->data + ysize +(pkt->size - ysize)/2, (pkt->size - ysize)/2); avio_write(pb[2], pkt->data + ysize +(pkt->size - ysize)/2, (pkt->size - ysize)/2);
put_flush_packet(pb[1]); avio_flush(pb[1]);
put_flush_packet(pb[2]); avio_flush(pb[2]);
avio_close(pb[1]); avio_close(pb[1]);
avio_close(pb[2]); avio_close(pb[2]);
}else{ }else{
@ -402,7 +402,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
} }
avio_write(pb[0], pkt->data, pkt->size); avio_write(pb[0], pkt->data, pkt->size);
} }
put_flush_packet(pb[0]); avio_flush(pb[0]);
if (!img->is_pipe) { if (!img->is_pipe) {
avio_close(pb[0]); avio_close(pb[0]);
} }

View File

@ -53,7 +53,7 @@ static int ivf_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_wl32(pb, pkt->size); avio_wl32(pb, pkt->size);
avio_wl64(pb, pkt->pts); avio_wl64(pb, pkt->pts);
avio_write(pb, pkt->data, pkt->size); avio_write(pb, pkt->data, pkt->size);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -48,7 +48,7 @@ static const AVCodecTag nut_tags[] = {
static int av_write(void * h, size_t len, const uint8_t * buf) { static int av_write(void * h, size_t len, const uint8_t * buf) {
AVIOContext * bc = h; AVIOContext * bc = h;
avio_write(bc, buf, len); avio_write(bc, buf, len);
//put_flush_packet(bc); //avio_flush(bc);
return len; return len;
} }
@ -142,7 +142,7 @@ static int nut_write_trailer(AVFormatContext * avf) {
int i; int i;
nut_muxer_uninit_reorder(priv->nut); nut_muxer_uninit_reorder(priv->nut);
put_flush_packet(bc); avio_flush(bc);
for(i = 0; priv->s[i].type != -1; i++ ) av_freep(&priv->s[i].fourcc); for(i = 0; priv->s[i].type != -1; i++ ) av_freep(&priv->s[i].fourcc);
av_freep(&priv->s); av_freep(&priv->s);

View File

@ -873,7 +873,7 @@ static int mkv_write_header(AVFormatContext *s)
mkv->cur_audio_pkt.size = 0; mkv->cur_audio_pkt.size = 0;
mkv->audio_buffer_size = 0; mkv->audio_buffer_size = 0;
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -1172,7 +1172,7 @@ static int mkv_write_trailer(AVFormatContext *s)
end_ebml_master(pb, mkv->segment); end_ebml_master(pb, mkv->segment);
av_free(mkv->tracks); av_free(mkv->tracks);
av_destruct_packet(&mkv->cur_audio_pkt); av_destruct_packet(&mkv->cur_audio_pkt);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -37,7 +37,7 @@ static void md5_finish(struct AVFormatContext *s, char *buf)
buf[offset+1] = 0; buf[offset+1] = 0;
avio_write(s->pb, buf, strlen(buf)); avio_write(s->pb, buf, strlen(buf));
put_flush_packet(s->pb); avio_flush(s->pb);
} }
#if CONFIG_MD5_MUXER #if CONFIG_MD5_MUXER

View File

@ -102,7 +102,7 @@ static int mmf_write_header(AVFormatContext *s)
av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate); av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -160,7 +160,7 @@ static int mmf_write_trailer(AVFormatContext *s)
avio_seek(pb, pos, SEEK_SET); avio_seek(pb, pos, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
} }
return 0; return 0;
} }

View File

@ -2042,7 +2042,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
trk->sampleCount += samplesInChunk; trk->sampleCount += samplesInChunk;
mov->mdat_size += size; mov->mdat_size += size;
put_flush_packet(pb); avio_flush(pb);
if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams)
ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry); ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry);
@ -2227,7 +2227,7 @@ static int mov_write_header(AVFormatContext *s)
} }
} }
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
error: error:
@ -2271,7 +2271,7 @@ static int mov_write_trailer(AVFormatContext *s)
} }
put_flush_packet(pb); avio_flush(pb);
av_freep(&mov->tracks); av_freep(&mov->tracks);

View File

@ -133,7 +133,7 @@ static int mp3_write_trailer(struct AVFormatContext *s)
/* write the id3v1 tag */ /* write the id3v1 tag */
if (id3v1_create_tag(s, buf) > 0) { if (id3v1_create_tag(s, buf) > 0) {
avio_write(s->pb, buf, ID3v1_TAG_SIZE); avio_write(s->pb, buf, ID3v1_TAG_SIZE);
put_flush_packet(s->pb); avio_flush(s->pb);
} }
return 0; return 0;
} }

View File

@ -936,7 +936,7 @@ static int flush_packet(AVFormatContext *ctx, int stream_index,
for(i=0;i<zero_trail_bytes;i++) for(i=0;i<zero_trail_bytes;i++)
avio_w8(ctx->pb, 0x00); avio_w8(ctx->pb, 0x00);
put_flush_packet(ctx->pb); avio_flush(ctx->pb);
s->packet_number++; s->packet_number++;
@ -965,7 +965,7 @@ static void put_vcd_padding_sector(AVFormatContext *ctx)
s->vcd_padding_bytes_written += s->packet_size; s->vcd_padding_bytes_written += s->packet_size;
put_flush_packet(ctx->pb); avio_flush(ctx->pb);
/* increasing the packet number is correct. The SCR of the following packs /* increasing the packet number is correct. The SCR of the following packs
is calculated from the packet_number and it has to include the padding is calculated from the packet_number and it has to include the padding
@ -1221,7 +1221,7 @@ static int mpeg_mux_end(AVFormatContext *ctx)
it as it is usually not needed by decoders and because it it as it is usually not needed by decoders and because it
complicates MPEG stream concatenation. */ complicates MPEG stream concatenation. */
//avio_wb32(ctx->pb, ISO_11172_END_CODE); //avio_wb32(ctx->pb, ISO_11172_END_CODE);
//put_flush_packet(ctx->pb); //avio_flush(ctx->pb);
for(i=0;i<ctx->nb_streams;i++) { for(i=0;i<ctx->nb_streams;i++) {
stream = ctx->streams[i]->priv_data; stream = ctx->streams[i]->priv_data;

View File

@ -579,7 +579,7 @@ static int mpegts_write_header(AVFormatContext *s)
service->pcr_packet_period, service->pcr_packet_period,
ts->sdt_packet_period, ts->pat_packet_period); ts->sdt_packet_period, ts->pat_packet_period);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
@ -865,7 +865,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
payload_size -= len; payload_size -= len;
avio_write(s->pb, buf, TS_PACKET_SIZE); avio_write(s->pb, buf, TS_PACKET_SIZE);
} }
put_flush_packet(s->pb); avio_flush(s->pb);
} }
static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
@ -988,7 +988,7 @@ static int mpegts_write_end(AVFormatContext *s)
} }
av_freep(&ts_st->adts); av_freep(&ts_st->adts);
} }
put_flush_packet(s->pb); avio_flush(s->pb);
for(i = 0; i < ts->nb_services; i++) { for(i = 0; i < ts->nb_services; i++) {
service = ts->services[i]; service = ts->services[i];

View File

@ -30,7 +30,7 @@ static int mpjpeg_write_header(AVFormatContext *s)
snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG); snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG);
avio_write(s->pb, buf1, strlen(buf1)); avio_write(s->pb, buf1, strlen(buf1));
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -44,7 +44,7 @@ static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
snprintf(buf1, sizeof(buf1), "\n--%s\n", BOUNDARY_TAG); snprintf(buf1, sizeof(buf1), "\n--%s\n", BOUNDARY_TAG);
avio_write(s->pb, buf1, strlen(buf1)); avio_write(s->pb, buf1, strlen(buf1));
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -1272,7 +1272,7 @@ static void mxf_write_partition(AVFormatContext *s, int bodysid,
avio_seek(pb, pos, SEEK_SET); avio_seek(pb, pos, SEEK_SET);
} }
put_flush_packet(pb); avio_flush(pb);
} }
static const UID mxf_mpeg2_codec_uls[] = { static const UID mxf_mpeg2_codec_uls[] = {
@ -1731,7 +1731,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
mxf->body_offset += 16+4+pkt->size + klv_fill_size(16+4+pkt->size); mxf->body_offset += 16+4+pkt->size + klv_fill_size(16+4+pkt->size);
} }
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -1795,7 +1795,7 @@ static int mxf_write_footer(AVFormatContext *s)
} }
} }
put_flush_packet(pb); avio_flush(pb);
ff_audio_interleave_close(s); ff_audio_interleave_close(s);

View File

@ -639,7 +639,7 @@ static int write_header(AVFormatContext *s){
if ((ret = write_headers(s, bc)) < 0) if ((ret = write_headers(s, bc)) < 0)
return ret; return ret;
put_flush_packet(bc); avio_flush(bc);
//FIXME index //FIXME index
@ -843,7 +843,7 @@ static int write_trailer(AVFormatContext *s){
while(nut->header_count<3) while(nut->header_count<3)
write_headers(s, bc); write_headers(s, bc);
put_flush_packet(bc); avio_flush(bc);
ff_nut_free_sp(nut); ff_nut_free_sp(nut);
av_freep(&nut->stream); av_freep(&nut->stream);
av_freep(&nut->time_base); av_freep(&nut->time_base);

View File

@ -99,14 +99,14 @@ static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
avio_write(pb, page->data, page->size); avio_write(pb, page->data, page->size);
ogg_update_checksum(s, pb, crc_offset); ogg_update_checksum(s, pb, crc_offset);
put_flush_packet(pb); avio_flush(pb);
size = url_close_dyn_buf(pb, &buf); size = url_close_dyn_buf(pb, &buf);
if (size < 0) if (size < 0)
return size; return size;
avio_write(s->pb, buf, size); avio_write(s->pb, buf, size);
put_flush_packet(s->pb); avio_flush(s->pb);
av_free(buf); av_free(buf);
oggstream->page_count--; oggstream->page_count--;
return 0; return 0;

View File

@ -26,7 +26,7 @@
int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt) int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
{ {
avio_write(s->pb, pkt->data, pkt->size); avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -341,7 +341,7 @@ static int rm_write_header(AVFormatContext *s)
if (rv10_write_header(s, 0, 0)) if (rv10_write_header(s, 0, 0))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -368,7 +368,7 @@ static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int
} else { } else {
avio_write(pb, buf, size); avio_write(pb, buf, size);
} }
put_flush_packet(pb); avio_flush(pb);
stream->nb_frames++; stream->nb_frames++;
av_free(buf1); av_free(buf1);
return 0; return 0;
@ -413,7 +413,7 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int
avio_w8(pb, stream->nb_frames & 0xff); avio_w8(pb, stream->nb_frames & 0xff);
avio_write(pb, buf, size); avio_write(pb, buf, size);
put_flush_packet(pb); avio_flush(pb);
stream->nb_frames++; stream->nb_frames++;
return 0; return 0;
@ -454,7 +454,7 @@ static int rm_write_trailer(AVFormatContext *s)
avio_wb32(pb, 0); avio_wb32(pb, 0);
avio_wb32(pb, 0); avio_wb32(pb, 0);
} }
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -60,7 +60,7 @@ static int rso_write_header(AVFormatContext *s)
avio_wb16(pb, enc->sample_rate); avio_wb16(pb, enc->sample_rate);
avio_wb16(pb, 0x0000); /* play mode ? (0x0000 = don't loop) */ avio_wb16(pb, 0x0000); /* play mode ? (0x0000 = don't loop) */
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -95,7 +95,7 @@ static int rso_write_trailer(AVFormatContext *s)
avio_wb16(pb, coded_file_size); avio_wb16(pb, coded_file_size);
avio_seek(pb, file_size, SEEK_SET); avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }

View File

@ -320,7 +320,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
avio_w8(pb, 0); avio_w8(pb, 0);
} }
put_flush_packet(pb); avio_flush(pb);
len = url_close_dyn_buf(pb, &buf); len = url_close_dyn_buf(pb, &buf);
if ((len > 0) && buf) { if ((len > 0) && buf) {
int result; int result;
@ -348,7 +348,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
avio_wb32(pb, 0); /* Timestamp */ avio_wb32(pb, 0); /* Timestamp */
avio_wb32(pb, 0); /* SSRC */ avio_wb32(pb, 0); /* SSRC */
put_flush_packet(pb); avio_flush(pb);
len = url_close_dyn_buf(pb, &buf); len = url_close_dyn_buf(pb, &buf);
if ((len > 0) && buf) if ((len > 0) && buf)
url_write(rtp_handle, buf, len); url_write(rtp_handle, buf, len);
@ -363,7 +363,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
avio_wb16(pb, 1); /* length in words - 1 */ avio_wb16(pb, 1); /* length in words - 1 */
avio_wb32(pb, 0); /* our own SSRC */ avio_wb32(pb, 0); /* our own SSRC */
put_flush_packet(pb); avio_flush(pb);
len = url_close_dyn_buf(pb, &buf); len = url_close_dyn_buf(pb, &buf);
if ((len > 0) && buf) if ((len > 0) && buf)
url_write(rtp_handle, buf, len); url_write(rtp_handle, buf, len);

View File

@ -206,7 +206,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
avio_wb32(s1->pb, rtp_ts); avio_wb32(s1->pb, rtp_ts);
avio_wb32(s1->pb, s->packet_count); avio_wb32(s1->pb, s->packet_count);
avio_wb32(s1->pb, s->octet_count); avio_wb32(s1->pb, s->octet_count);
put_flush_packet(s1->pb); avio_flush(s1->pb);
} }
/* send an rtp packet. sequence number is incremented, but the caller /* send an rtp packet. sequence number is incremented, but the caller
@ -225,7 +225,7 @@ void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
avio_wb32(s1->pb, s->ssrc); avio_wb32(s1->pb, s->ssrc);
avio_write(s1->pb, buf1, len); avio_write(s1->pb, buf1, len);
put_flush_packet(s1->pb); avio_flush(s1->pb);
s->seq++; s->seq++;
s->octet_count += len; s->octet_count += len;

View File

@ -78,7 +78,7 @@ static int sox_write_header(AVFormatContext *s)
for ( ; comment_size > comment_len; comment_len++) for ( ; comment_size > comment_len; comment_len++)
avio_w8(pb, 0); avio_w8(pb, 0);
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -107,7 +107,7 @@ static int sox_write_trailer(AVFormatContext *s)
avio_wb64(pb, num_samples); avio_wb64(pb, num_samples);
avio_seek(pb, file_size, SEEK_SET); avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
} }
return 0; return 0;

View File

@ -531,7 +531,7 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_DEBUG, "type=%x len=%i pkt_offset=%i\n", av_log(s, AV_LOG_DEBUG, "type=%x len=%i pkt_offset=%i\n",
ctx->data_type, ctx->out_bytes, ctx->pkt_offset); ctx->data_type, ctx->out_bytes, ctx->pkt_offset);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }

View File

@ -326,7 +326,7 @@ static int swf_write_header(AVFormatContext *s)
put_swf_end_tag(s); put_swf_end_tag(s);
} }
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -432,7 +432,7 @@ static int swf_write_video(AVFormatContext *s,
put_swf_tag(s, TAG_SHOWFRAME); put_swf_tag(s, TAG_SHOWFRAME);
put_swf_end_tag(s); put_swf_end_tag(s);
put_flush_packet(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
@ -489,7 +489,7 @@ static int swf_write_trailer(AVFormatContext *s)
put_swf_tag(s, TAG_END); put_swf_tag(s, TAG_END);
put_swf_end_tag(s); put_swf_end_tag(s);
put_flush_packet(s->pb); avio_flush(s->pb);
/* patch file size and number of frames if not streamed */ /* patch file size and number of frames if not streamed */
if (!url_is_streamed(s->pb) && video_enc) { if (!url_is_streamed(s->pb) && video_enc) {

View File

@ -62,7 +62,7 @@ static int vc1test_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_wl32(pb, pkt->size | ((pkt->flags & AV_PKT_FLAG_KEY) ? 0x80000000 : 0)); avio_wl32(pb, pkt->size | ((pkt->flags & AV_PKT_FLAG_KEY) ? 0x80000000 : 0));
avio_wl32(pb, pkt->pts); avio_wl32(pb, pkt->pts);
avio_write(pb, pkt->data, pkt->size); avio_write(pb, pkt->data, pkt->size);
put_flush_packet(pb); avio_flush(pb);
ctx->frames++; ctx->frames++;
return 0; return 0;
@ -76,7 +76,7 @@ static int vc1test_write_trailer(AVFormatContext *s)
if (!url_is_streamed(s->pb)) { if (!url_is_streamed(s->pb)) {
avio_seek(pb, 0, SEEK_SET); avio_seek(pb, 0, SEEK_SET);
avio_wl24(pb, ctx->frames); avio_wl24(pb, ctx->frames);
put_flush_packet(pb); avio_flush(pb);
} }
return 0; return 0;
} }

View File

@ -71,7 +71,7 @@ static int wav_write_header(AVFormatContext *s)
/* data header */ /* data header */
wav->data = ff_start_tag(pb, "data"); wav->data = ff_start_tag(pb, "data");
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }
@ -96,7 +96,7 @@ static int wav_write_trailer(AVFormatContext *s)
WAVContext *wav = s->priv_data; WAVContext *wav = s->priv_data;
int64_t file_size; int64_t file_size;
put_flush_packet(pb); avio_flush(pb);
if (!url_is_streamed(s->pb)) { if (!url_is_streamed(s->pb)) {
ff_end_tag(pb, wav->data); ff_end_tag(pb, wav->data);
@ -107,7 +107,7 @@ static int wav_write_trailer(AVFormatContext *s)
avio_wl32(pb, (uint32_t)(file_size - 8)); avio_wl32(pb, (uint32_t)(file_size - 8));
avio_seek(pb, file_size, SEEK_SET); avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
if(s->streams[0]->codec->codec_tag != 0x01) { if(s->streams[0]->codec->codec_tag != 0x01) {
/* Update num_samps in fact chunk */ /* Update num_samps in fact chunk */
@ -118,7 +118,7 @@ static int wav_write_trailer(AVFormatContext *s)
avio_seek(pb, wav->data-12, SEEK_SET); avio_seek(pb, wav->data-12, SEEK_SET);
avio_wl32(pb, number_of_samples); avio_wl32(pb, number_of_samples);
avio_seek(pb, file_size, SEEK_SET); avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb); avio_flush(pb);
} }
} }
return 0; return 0;

View File

@ -143,7 +143,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
ptr2 += picture->linesize[2]; ptr2 += picture->linesize[2];
} }
} }
put_flush_packet(pb); avio_flush(pb);
return 0; return 0;
} }