Skip to content

Commit

Permalink
avio: rename put_flush_packet -> avio_flush
Browse files Browse the repository at this point in the history
Signed-off-by: Ronald S. Bultje <[email protected]>
  • Loading branch information
elenril authored and rbultje committed Mar 17, 2011
1 parent 35f1023 commit b7f2fdd
Show file tree
Hide file tree
Showing 47 changed files with 104 additions and 99 deletions.
2 changes: 1 addition & 1 deletion libavformat/a64.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt)
break;
}

put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/adtsenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
}
}
avio_write(pb, pkt->data, pkt->size);
put_flush_packet(pb);
avio_flush(pb);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions libavformat/aiffenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/* Data is starting here */
put_flush_packet(pb);
avio_flush(pb);

return 0;
}
Expand Down Expand Up @@ -140,7 +140,7 @@ static int aiff_write_trailer(AVFormatContext *s)
/* return to the end */
avio_seek(pb, end_size, SEEK_SET);

put_flush_packet(pb);
avio_flush(pb);
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions libavformat/amr.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ static int amr_write_header(AVFormatContext *s)
{
return -1;
}
put_flush_packet(pb);
avio_flush(pb);
return 0;
}

static int amr_write_packet(AVFormatContext *s, AVPacket *pkt)
{
avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}
#endif /* CONFIG_AMR_MUXER */
Expand Down
8 changes: 4 additions & 4 deletions libavformat/asfenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static int asf_write_header(AVFormatContext *s)
return -1;
}

put_flush_packet(s->pb);
avio_flush(s->pb);

asf->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1;
Expand Down Expand Up @@ -672,7 +672,7 @@ static void flush_packet(AVFormatContext *s)

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->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1;
Expand Down Expand Up @@ -864,7 +864,7 @@ static int asf_write_trailer(AVFormatContext *s)
if ((!asf->is_streamed) && (asf->nb_index_count != 0)) {
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)) {
put_chunk(s, 0x4524, 0, 0); /* end of stream */
Expand All @@ -875,7 +875,7 @@ static int asf_write_trailer(AVFormatContext *s)
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);
return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions libavformat/assenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int write_header(AVFormatContext *s)
last=p;
}

put_flush_packet(s->pb);
avio_flush(s->pb);

return 0;
}
Expand All @@ -59,7 +59,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
{
avio_write(s->pb, pkt->data, pkt->size);

put_flush_packet(s->pb);
avio_flush(s->pb);

return 0;
}
Expand All @@ -72,7 +72,7 @@ static int write_trailer(AVFormatContext *s)
avio_write(s->pb, avctx->extradata + ass->extra_index,
avctx->extradata_size - ass->extra_index);

put_flush_packet(s->pb);
avio_flush(s->pb);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions libavformat/au.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int au_write_header(AVFormatContext *s)
return -1;
}

put_flush_packet(pb);
avio_flush(pb);

return 0;
}
Expand All @@ -99,7 +99,7 @@ static int au_write_trailer(AVFormatContext *s)
avio_wb32(pb, (uint32_t)(file_size - 24));
avio_seek(pb, file_size, SEEK_SET);

put_flush_packet(pb);
avio_flush(pb);
}

return 0;
Expand Down
8 changes: 4 additions & 4 deletions libavformat/avienc.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static int avi_write_header(AVFormatContext *s)
avi->movi_list = ff_start_tag(pb, "LIST");
ffio_wfourcc(pb, "movi");

put_flush_packet(pb);
avio_flush(pb);

return 0;
}
Expand Down Expand Up @@ -438,7 +438,7 @@ static int avi_write_ix(AVFormatContext *s)
avio_wl32(pb, ((uint32_t)ie->len & ~0x80000000) |
(ie->flags & 0x10 ? 0 : 0x80000000));
}
put_flush_packet(pb);
avio_flush(pb);
pos = avio_tell(pb);

/* Updating one entry in the AVI OpenDML master index */
Expand Down Expand Up @@ -578,7 +578,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
if (size & 1)
avio_w8(pb, 0);

put_flush_packet(pb);
avio_flush(pb);
return 0;
}

Expand Down Expand Up @@ -624,7 +624,7 @@ static int avi_write_trailer(AVFormatContext *s)
avi_write_counters(s, avi->riff_id);
}
}
put_flush_packet(pb);
avio_flush(pb);

for (i=0; i<s->nb_streams; i++) {
AVIStream *avist= s->streams[i]->priv_data;
Expand Down
3 changes: 2 additions & 1 deletion libavformat/avio.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __att
#else
attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
#endif
attribute_deprecated void put_flush_packet(AVIOContext *s);
/**
* @}
*/
Expand Down Expand Up @@ -529,7 +530,7 @@ int avio_printf(AVIOContext *s, const char *fmt, ...);
attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
#endif

void put_flush_packet(AVIOContext *s);
void avio_flush(AVIOContext *s);


/**
Expand Down
10 changes: 7 additions & 3 deletions libavformat/aviobuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
s->must_flush = 0;
Expand Down Expand Up @@ -393,6 +393,10 @@ int url_fprintf(AVIOContext *s, const char *fmt, ...)
avio_write(s, buf, strlen(buf));
return ret;
}
void put_flush_packet(AVIOContext *s)
{
avio_flush(s);
}
#endif

int avio_put_str(AVIOContext *s, const char *str)
Expand Down Expand Up @@ -1013,7 +1017,7 @@ int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags)

int url_close_buf(AVIOContext *s)
{
put_flush_packet(s);
avio_flush(s);
return s->buf_ptr - s->buffer;
}
#endif
Expand Down Expand Up @@ -1141,7 +1145,7 @@ int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
padding = FF_INPUT_BUFFER_PADDING_SIZE;
}

put_flush_packet(s);
avio_flush(s);

*pbuffer = d->buffer;
size = d->size;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/crcenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int crc_write_trailer(struct AVFormatContext *s)

snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval);
avio_write(s->pb, buf, strlen(buf));
put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/daud.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
avio_wb16(s->pb, pkt->size);
avio_wb16(s->pb, 0x8010); // unknown
avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/dvenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static int dv_write_packet(struct AVFormatContext *s, AVPacket *pkt)
pkt->data, pkt->size, &frame);
if (fsize > 0) {
avio_write(s->pb, frame, fsize);
put_flush_packet(s->pb);
avio_flush(s->pb);
}
return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions libavformat/ffmenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void flush_packet(AVFormatContext *s)
h |= 0x8000;
avio_wb16(pb, h);
avio_write(pb, ffm->packet, ffm->packet_end - ffm->packet);
put_flush_packet(pb);
avio_flush(pb);

/* prepare next packet */
ffm->frame_offset = 0; /* no key frame */
Expand Down Expand Up @@ -187,7 +187,7 @@ static int ffm_write_header(AVFormatContext *s)
while ((avio_tell(pb) % ffm->packet_size) != 0)
avio_w8(pb, 0);

put_flush_packet(pb);
avio_flush(pb);

/* init packet mux */
ffm->packet_ptr = ffm->packet;
Expand Down Expand Up @@ -235,7 +235,7 @@ static int ffm_write_trailer(AVFormatContext *s)
if (ffm->packet_ptr > ffm->packet)
flush_packet(s);

put_flush_packet(pb);
avio_flush(pb);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions libavformat/ffmetaenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int write_header(AVFormatContext *s)
avio_write(s->pb, ID_STRING, sizeof(ID_STRING) - 1);
avio_w8(s->pb, '1'); // version
avio_w8(s->pb, '\n');
put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand All @@ -79,7 +79,7 @@ static int write_trailer(AVFormatContext *s)
write_tags(s->pb, ch->metadata);
}

put_flush_packet(s->pb);
avio_flush(s->pb);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion libavformat/filmstripenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static int write_trailer(AVFormatContext *s)
avio_wb16(pb, 1/av_q2d(st->codec->time_base));
for (i = 0; i < 16; i++)
avio_w8(pb, 0x00); // reserved
put_flush_packet(pb);
avio_flush(pb);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions libavformat/flacenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int flac_write_trailer(struct AVFormatContext *s)
avio_seek(pb, 8, SEEK_SET);
avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE);
avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
avio_flush(pb);
} else {
av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
}
Expand All @@ -114,7 +114,7 @@ static int flac_write_trailer(struct AVFormatContext *s)
static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/flvenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/framecrcenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
avio_write(s->pb, buf, strlen(buf));
put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions libavformat/gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static int gif_write_header(AVFormatContext *s)

gif_image_write_header(pb, width, height, loop_count, NULL);

put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand Down Expand Up @@ -322,7 +322,7 @@ static int gif_write_video(AVFormatContext *s,
gif_image_write_image(pb, 0, 0, enc->width, enc->height,
buf, enc->width * 3, PIX_FMT_RGB24);

put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand All @@ -340,7 +340,7 @@ static int gif_write_trailer(AVFormatContext *s)
AVIOContext *pb = s->pb;

avio_w8(pb, 0x3b);
put_flush_packet(s->pb);
avio_flush(s->pb);
return 0;
}

Expand Down
Loading

0 comments on commit b7f2fdd

Please sign in to comment.