Skip to content

Commit

Permalink
avformat: remove unneeded avio_flush() calls before calling avio_clos…
Browse files Browse the repository at this point in the history
…e_dyn_buf()

avio_close_dyn_buf() also does avio_flush().

Signed-off-by: Marton Balint <[email protected]>
  • Loading branch information
cus committed Jan 7, 2020
1 parent 37d24a6 commit 4d7f825
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions libavformat/hlsenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ static int flush_dynbuf(VariantStream *vs, int *range_length)

// flush
av_write_frame(ctx, NULL);
avio_flush(ctx->pb);

// write out to file
*range_length = avio_close_dyn_buf(ctx->pb, &vs->temp_buffer);
Expand Down Expand Up @@ -2548,7 +2547,6 @@ static int hls_write_trailer(struct AVFormatContext *s)
if (!vs->init_range_length) {
uint8_t *buffer = NULL;
av_write_frame(oc, NULL); /* Flush any buffered data */
avio_flush(oc->pb);

range_length = avio_close_dyn_buf(oc->pb, &buffer);
avio_write(vs->out, buffer, range_length);
Expand Down
1 change: 0 additions & 1 deletion libavformat/oggenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
avio_write(pb, page->data, page->size);

ogg_update_checksum(s, pb, crc_offset);
avio_flush(pb);

size = avio_close_dyn_buf(pb, &buf);
if (size < 0)
Expand Down
2 changes: 0 additions & 2 deletions libavformat/rtpdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ void ff_rtp_send_punch_packets(URLContext *rtp_handle)
avio_wb32(pb, 0); /* Timestamp */
avio_wb32(pb, 0); /* SSRC */

avio_flush(pb);
len = avio_close_dyn_buf(pb, &buf);
if ((len > 0) && buf)
ffurl_write(rtp_handle, buf, len);
Expand All @@ -430,7 +429,6 @@ void ff_rtp_send_punch_packets(URLContext *rtp_handle)
avio_wb16(pb, 1); /* length in words - 1 */
avio_wb32(pb, 0); /* our own SSRC */

avio_flush(pb);
len = avio_close_dyn_buf(pb, &buf);
if ((len > 0) && buf)
ffurl_write(rtp_handle, buf, len);
Expand Down

0 comments on commit 4d7f825

Please sign in to comment.