Commit 6dc7d80d authored by Anton Khirnov's avatar Anton Khirnov

avio: avio_ prefix for url_close_dyn_buf

parent b92c5452
...@@ -872,7 +872,7 @@ static void close_connection(HTTPContext *c) ...@@ -872,7 +872,7 @@ static void close_connection(HTTPContext *c)
if (avio_open_dyn_buf(&ctx->pb) >= 0) { if (avio_open_dyn_buf(&ctx->pb) >= 0) {
av_write_trailer(ctx); av_write_trailer(ctx);
av_freep(&c->pb_buffer); av_freep(&c->pb_buffer);
url_close_dyn_buf(ctx->pb, &c->pb_buffer); avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
} }
} }
} }
...@@ -2101,7 +2101,7 @@ static void compute_status(HTTPContext *c) ...@@ -2101,7 +2101,7 @@ static void compute_status(HTTPContext *c)
avio_printf(pb, "<hr size=1 noshade>Generated at %s", p); avio_printf(pb, "<hr size=1 noshade>Generated at %s", p);
avio_printf(pb, "</body>\n</html>\n"); avio_printf(pb, "</body>\n</html>\n");
len = url_close_dyn_buf(pb, &c->pb_buffer); len = avio_close_dyn_buf(pb, &c->pb_buffer);
c->buffer_ptr = c->pb_buffer; c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len; c->buffer_end = c->pb_buffer + len;
} }
...@@ -2277,7 +2277,7 @@ static int http_prepare_data(HTTPContext *c) ...@@ -2277,7 +2277,7 @@ static int http_prepare_data(HTTPContext *c)
} }
av_metadata_free(&c->fmt_ctx.metadata); av_metadata_free(&c->fmt_ctx.metadata);
len = url_close_dyn_buf(c->fmt_ctx.pb, &c->pb_buffer); len = avio_close_dyn_buf(c->fmt_ctx.pb, &c->pb_buffer);
c->buffer_ptr = c->pb_buffer; c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len; c->buffer_end = c->pb_buffer + len;
...@@ -2410,7 +2410,7 @@ static int http_prepare_data(HTTPContext *c) ...@@ -2410,7 +2410,7 @@ static int http_prepare_data(HTTPContext *c)
c->state = HTTPSTATE_SEND_DATA_TRAILER; c->state = HTTPSTATE_SEND_DATA_TRAILER;
} }
len = url_close_dyn_buf(ctx->pb, &c->pb_buffer); len = avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
c->cur_frame_bytes = len; c->cur_frame_bytes = len;
c->buffer_ptr = c->pb_buffer; c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len; c->buffer_end = c->pb_buffer + len;
...@@ -2438,7 +2438,7 @@ static int http_prepare_data(HTTPContext *c) ...@@ -2438,7 +2438,7 @@ static int http_prepare_data(HTTPContext *c)
} }
c->fmt_ctx.pb->seekable = 0; c->fmt_ctx.pb->seekable = 0;
av_write_trailer(ctx); av_write_trailer(ctx);
len = url_close_dyn_buf(ctx->pb, &c->pb_buffer); len = avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
c->buffer_ptr = c->pb_buffer; c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len; c->buffer_end = c->pb_buffer + len;
...@@ -2518,7 +2518,7 @@ static int http_send_data(HTTPContext *c) ...@@ -2518,7 +2518,7 @@ static int http_send_data(HTTPContext *c)
/* write RTP packet data */ /* write RTP packet data */
c->buffer_ptr += 4; c->buffer_ptr += 4;
avio_write(pb, c->buffer_ptr, len); avio_write(pb, c->buffer_ptr, len);
size = url_close_dyn_buf(pb, &c->packet_buffer); size = avio_close_dyn_buf(pb, &c->packet_buffer);
/* prepare asynchronous TCP sending */ /* prepare asynchronous TCP sending */
rtsp_c->packet_buffer_ptr = c->packet_buffer; rtsp_c->packet_buffer_ptr = c->packet_buffer;
rtsp_c->packet_buffer_end = c->packet_buffer + size; rtsp_c->packet_buffer_end = c->packet_buffer + size;
...@@ -2907,7 +2907,7 @@ static int rtsp_parse_request(HTTPContext *c) ...@@ -2907,7 +2907,7 @@ static int rtsp_parse_request(HTTPContext *c)
rtsp_reply_error(c, RTSP_STATUS_METHOD); rtsp_reply_error(c, RTSP_STATUS_METHOD);
the_end: the_end:
len = url_close_dyn_buf(c->pb, &c->pb_buffer); len = avio_close_dyn_buf(c->pb, &c->pb_buffer);
c->pb = NULL; /* safety */ c->pb = NULL; /* safety */
if (len < 0) { if (len < 0) {
/* XXX: cannot do more */ /* XXX: cannot do more */
...@@ -3456,7 +3456,7 @@ static int rtp_new_av_stream(HTTPContext *c, ...@@ -3456,7 +3456,7 @@ static int rtp_new_av_stream(HTTPContext *c,
av_free(ctx); av_free(ctx);
return -1; return -1;
} }
url_close_dyn_buf(ctx->pb, &dummy_buf); avio_close_dyn_buf(ctx->pb, &dummy_buf);
av_free(dummy_buf); av_free(dummy_buf);
c->rtp_ctx[stream_index] = ctx; c->rtp_ctx[stream_index] = ctx;
......
...@@ -238,7 +238,7 @@ static void put_str16(AVIOContext *s, const char *tag) ...@@ -238,7 +238,7 @@ static void put_str16(AVIOContext *s, const char *tag)
return; return;
avio_put_str16le(dyn_buf, tag); avio_put_str16le(dyn_buf, tag);
len = url_close_dyn_buf(dyn_buf, &pb); len = avio_close_dyn_buf(dyn_buf, &pb);
avio_wl16(s, len); avio_wl16(s, len);
avio_write(s, pb, len); avio_write(s, pb, len);
av_freep(&pb); av_freep(&pb);
...@@ -375,7 +375,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data ...@@ -375,7 +375,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
len = tags[n] ? avio_put_str16le(dyn_buf, tags[n]->value) : 0; len = tags[n] ? avio_put_str16le(dyn_buf, tags[n]->value) : 0;
avio_wl16(pb, len); avio_wl16(pb, len);
} }
len = url_close_dyn_buf(dyn_buf, &buf); len = avio_close_dyn_buf(dyn_buf, &buf);
avio_write(pb, buf, len); avio_write(pb, buf, len);
av_freep(&buf); av_freep(&buf);
end_header(pb, hpos); end_header(pb, hpos);
...@@ -501,7 +501,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data ...@@ -501,7 +501,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
avio_put_str16le(dyn_buf, desc); avio_put_str16le(dyn_buf, desc);
len = url_close_dyn_buf(dyn_buf, &buf); len = avio_close_dyn_buf(dyn_buf, &buf);
avio_wl16(pb, len / 2); // "number of characters" = length in bytes / 2 avio_wl16(pb, len / 2); // "number of characters" = length in bytes / 2
avio_write(pb, buf, len); avio_write(pb, buf, len);
......
...@@ -96,7 +96,7 @@ int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size) ...@@ -96,7 +96,7 @@ int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
ff_avc_parse_nal_units(pb, buf_in, *size); ff_avc_parse_nal_units(pb, buf_in, *size);
av_freep(buf); av_freep(buf);
*size = url_close_dyn_buf(pb, buf); *size = avio_close_dyn_buf(pb, buf);
return 0; return 0;
} }
......
...@@ -448,6 +448,7 @@ attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...); ...@@ -448,6 +448,7 @@ attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
#endif #endif
attribute_deprecated void put_flush_packet(AVIOContext *s); attribute_deprecated void put_flush_packet(AVIOContext *s);
attribute_deprecated int url_open_dyn_buf(AVIOContext **s); attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
/** /**
* @} * @}
*/ */
...@@ -704,7 +705,7 @@ int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); ...@@ -704,7 +705,7 @@ int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
* @param pbuffer pointer to a byte buffer * @param pbuffer pointer to a byte buffer
* @return the length of the byte buffer * @return the length of the byte buffer
*/ */
int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
#if FF_API_UDP_GET_FILE #if FF_API_UDP_GET_FILE
int udp_get_file_handle(URLContext *h); int udp_get_file_handle(URLContext *h);
......
...@@ -423,6 +423,10 @@ int url_open_dyn_buf(AVIOContext **s) ...@@ -423,6 +423,10 @@ int url_open_dyn_buf(AVIOContext **s)
{ {
return avio_open_dyn_buf(s); return avio_open_dyn_buf(s);
} }
int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
{
return avio_close_dyn_buf(s, pbuffer);
}
#endif #endif
int avio_put_str(AVIOContext *s, const char *str) int avio_put_str(AVIOContext *s, const char *str)
...@@ -1027,7 +1031,7 @@ int64_t ffio_read_seek(AVIOContext *s, int stream_index, ...@@ -1027,7 +1031,7 @@ int64_t ffio_read_seek(AVIOContext *s, int stream_index,
return ret; return ret;
} }
/* avio_open_dyn_buf and url_close_dyn_buf are used in rtp.c to send a response /* avio_open_dyn_buf and avio_close_dyn_buf are used in rtp.c to send a response
* back to the server even if CONFIG_MUXERS is false. */ * back to the server even if CONFIG_MUXERS is false. */
#if CONFIG_MUXERS || CONFIG_NETWORK #if CONFIG_MUXERS || CONFIG_NETWORK
/* buffer handling */ /* buffer handling */
...@@ -1163,7 +1167,7 @@ int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size) ...@@ -1163,7 +1167,7 @@ int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
return url_open_dyn_buf_internal(s, max_packet_size); return url_open_dyn_buf_internal(s, max_packet_size);
} }
int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
{ {
DynBuffer *d = s->opaque; DynBuffer *d = s->opaque;
int size; int size;
......
...@@ -498,7 +498,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo ...@@ -498,7 +498,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
ff_put_wav_header(dyn_cp, codec); ff_put_wav_header(dyn_cp, codec);
} }
codecpriv_size = url_close_dyn_buf(dyn_cp, &codecpriv); codecpriv_size = avio_close_dyn_buf(dyn_cp, &codecpriv);
if (codecpriv_size) if (codecpriv_size)
put_ebml_binary(pb, MATROSKA_ID_CODECPRIVATE, codecpriv, codecpriv_size); put_ebml_binary(pb, MATROSKA_ID_CODECPRIVATE, codecpriv, codecpriv_size);
av_free(codecpriv); av_free(codecpriv);
...@@ -1003,7 +1003,7 @@ static void mkv_flush_dynbuf(AVFormatContext *s) ...@@ -1003,7 +1003,7 @@ static void mkv_flush_dynbuf(AVFormatContext *s)
if (!mkv->dyn_bc) if (!mkv->dyn_bc)
return; return;
bufsize = url_close_dyn_buf(mkv->dyn_bc, &dyn_buf); bufsize = avio_close_dyn_buf(mkv->dyn_bc, &dyn_buf);
avio_write(s->pb, dyn_buf, bufsize); avio_write(s->pb, dyn_buf, bufsize);
av_free(dyn_buf); av_free(dyn_buf);
mkv->dyn_bc = NULL; mkv->dyn_bc = NULL;
......
...@@ -1691,7 +1691,7 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, ...@@ -1691,7 +1691,7 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
if (s->nb_chapters) if (s->nb_chapters)
mov_write_chpl_tag(pb_buf, s); mov_write_chpl_tag(pb_buf, s);
if ((size = url_close_dyn_buf(pb_buf, &buf)) > 0) { if ((size = avio_close_dyn_buf(pb_buf, &buf)) > 0) {
avio_wb32(pb, size+8); avio_wb32(pb, size+8);
ffio_wfourcc(pb, "udta"); ffio_wfourcc(pb, "udta");
avio_write(pb, buf, size); avio_write(pb, buf, size);
......
...@@ -408,7 +408,7 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, ...@@ -408,7 +408,7 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
/* Fetch the output from the RTP muxer, open a new output buffer /* Fetch the output from the RTP muxer, open a new output buffer
* for next time. */ * for next time. */
size = url_close_dyn_buf(rtp_ctx->pb, &buf); size = avio_close_dyn_buf(rtp_ctx->pb, &buf);
if ((ret = url_open_dyn_packet_buf(&rtp_ctx->pb, if ((ret = url_open_dyn_packet_buf(&rtp_ctx->pb,
RTP_MAX_PACKET_SIZE)) < 0) RTP_MAX_PACKET_SIZE)) < 0)
goto done; goto done;
...@@ -424,7 +424,7 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, ...@@ -424,7 +424,7 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
av_freep(&buf); av_freep(&buf);
/* Write the hint data into the hint track */ /* Write the hint data into the hint track */
hint_pkt.size = size = url_close_dyn_buf(hintbuf, &buf); hint_pkt.size = size = avio_close_dyn_buf(hintbuf, &buf);
hint_pkt.data = buf; hint_pkt.data = buf;
hint_pkt.pts = hint_pkt.dts; hint_pkt.pts = hint_pkt.dts;
hint_pkt.stream_index = track_index; hint_pkt.stream_index = track_index;
...@@ -448,7 +448,7 @@ void ff_mov_close_hinting(MOVTrack *track) { ...@@ -448,7 +448,7 @@ void ff_mov_close_hinting(MOVTrack *track) {
return; return;
if (rtp_ctx->pb) { if (rtp_ctx->pb) {
av_write_trailer(rtp_ctx); av_write_trailer(rtp_ctx);
url_close_dyn_buf(rtp_ctx->pb, &ptr); avio_close_dyn_buf(rtp_ctx->pb, &ptr);
av_free(ptr); av_free(ptr);
} }
avformat_free_context(rtp_ctx); avformat_free_context(rtp_ctx);
......
...@@ -115,7 +115,7 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2 ...@@ -115,7 +115,7 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2
put(dyn_buf, str1); put(dyn_buf, str1);
if (str2) if (str2)
put(dyn_buf, str2); put(dyn_buf, str2);
len = url_close_dyn_buf(dyn_buf, &pb); len = avio_close_dyn_buf(dyn_buf, &pb);
avio_wb32(s->pb, tag); avio_wb32(s->pb, tag);
id3v2_put_size(s, len); id3v2_put_size(s, len);
......
...@@ -281,7 +281,7 @@ static inline void put_s_trace(AVIOContext *bc, int64_t v, char *file, char *fun ...@@ -281,7 +281,7 @@ static inline void put_s_trace(AVIOContext *bc, int64_t v, char *file, char *fun
//FIXME remove calculate_checksum //FIXME remove calculate_checksum
static void put_packet(NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc, int calculate_checksum, uint64_t startcode){ static void put_packet(NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc, int calculate_checksum, uint64_t startcode){
uint8_t *dyn_buf=NULL; uint8_t *dyn_buf=NULL;
int dyn_size= url_close_dyn_buf(dyn_bc, &dyn_buf); int dyn_size= avio_close_dyn_buf(dyn_bc, &dyn_buf);
int forw_ptr= dyn_size + 4*calculate_checksum; int forw_ptr= dyn_size + 4*calculate_checksum;
if(forw_ptr > 4096) if(forw_ptr > 4096)
...@@ -450,7 +450,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc){ ...@@ -450,7 +450,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc){
ff_put_v(bc, count); ff_put_v(bc, count);
dyn_size= url_close_dyn_buf(dyn_bc, &dyn_buf); dyn_size= avio_close_dyn_buf(dyn_bc, &dyn_buf);
avio_write(bc, dyn_buf, dyn_size); avio_write(bc, dyn_buf, dyn_size);
av_free(dyn_buf); av_free(dyn_buf);
return 0; return 0;
...@@ -470,7 +470,7 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id){ ...@@ -470,7 +470,7 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id){
if (st->disposition & ff_nut_dispositions[i].flag) if (st->disposition & ff_nut_dispositions[i].flag)
count += add_info(dyn_bc, "Disposition", ff_nut_dispositions[i].str); count += add_info(dyn_bc, "Disposition", ff_nut_dispositions[i].str);
} }
dyn_size = url_close_dyn_buf(dyn_bc, &dyn_buf); dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
if (count) { if (count) {
ff_put_v(bc, stream_id + 1); //stream_id_plus1 ff_put_v(bc, stream_id + 1); //stream_id_plus1
...@@ -509,7 +509,7 @@ static int write_chapter(NUTContext *nut, AVIOContext *bc, int id) ...@@ -509,7 +509,7 @@ static int write_chapter(NUTContext *nut, AVIOContext *bc, int id)
ff_put_v(bc, count); ff_put_v(bc, count);
dyn_size = url_close_dyn_buf(dyn_bc, &dyn_buf); dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
avio_write(bc, dyn_buf, dyn_size); avio_write(bc, dyn_buf, dyn_size);
av_freep(&dyn_buf); av_freep(&dyn_buf);
return 0; return 0;
...@@ -554,7 +554,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){ ...@@ -554,7 +554,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE); put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
else { else {
uint8_t* buf; uint8_t* buf;
url_close_dyn_buf(dyn_bc, &buf); avio_close_dyn_buf(dyn_bc, &buf);
av_free(buf); av_free(buf);
} }
} }
...@@ -566,7 +566,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){ ...@@ -566,7 +566,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
ret = write_chapter(nut, dyn_bc, i); ret = write_chapter(nut, dyn_bc, i);
if (ret < 0) { if (ret < 0) {
uint8_t *buf; uint8_t *buf;
url_close_dyn_buf(dyn_bc, &buf); avio_close_dyn_buf(dyn_bc, &buf);
av_freep(&buf); av_freep(&buf);
return ret; return ret;
} }
......
...@@ -101,7 +101,7 @@ static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags) ...@@ -101,7 +101,7 @@ static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
ogg_update_checksum(s, pb, crc_offset); ogg_update_checksum(s, pb, crc_offset);
avio_flush(pb); avio_flush(pb);
size = url_close_dyn_buf(pb, &buf); size = avio_close_dyn_buf(pb, &buf);
if (size < 0) if (size < 0)
return size; return size;
......
...@@ -321,7 +321,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count) ...@@ -321,7 +321,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
} }
avio_flush(pb); avio_flush(pb);
len = url_close_dyn_buf(pb, &buf); len = avio_close_dyn_buf(pb, &buf);
if ((len > 0) && buf) { if ((len > 0) && buf) {
int result; int result;
av_dlog(s->ic, "sending %d bytes of RR\n", len); av_dlog(s->ic, "sending %d bytes of RR\n", len);
...@@ -349,7 +349,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle) ...@@ -349,7 +349,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
avio_wb32(pb, 0); /* SSRC */ avio_wb32(pb, 0); /* SSRC */
avio_flush(pb); avio_flush(pb);
len = url_close_dyn_buf(pb, &buf); len = avio_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);
av_free(buf); av_free(buf);
...@@ -364,7 +364,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle) ...@@ -364,7 +364,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
avio_wb32(pb, 0); /* our own SSRC */ avio_wb32(pb, 0); /* our own SSRC */
avio_flush(pb); avio_flush(pb);
len = url_close_dyn_buf(pb, &buf); len = avio_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);
av_free(buf); av_free(buf);
......
...@@ -203,7 +203,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf, ...@@ -203,7 +203,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
*/ */
if (asf->pktbuf && len_off != avio_tell(asf->pktbuf)) { if (asf->pktbuf && len_off != avio_tell(asf->pktbuf)) {
uint8_t *p; uint8_t *p;
url_close_dyn_buf(asf->pktbuf, &p); avio_close_dyn_buf(asf->pktbuf, &p);
asf->pktbuf = NULL; asf->pktbuf = NULL;
av_free(p); av_free(p);
} }
...@@ -217,7 +217,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf, ...@@ -217,7 +217,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
avio_skip(pb, len - off); avio_skip(pb, len - off);
if (!(flags & RTP_FLAG_MARKER)) if (!(flags & RTP_FLAG_MARKER))
return -1; return -1;
out_len = url_close_dyn_buf(asf->pktbuf, &asf->buf); out_len = avio_close_dyn_buf(asf->pktbuf, &asf->buf);
asf->pktbuf = NULL; asf->pktbuf = NULL;
} else { } else {
/** /**
...@@ -272,7 +272,7 @@ static void asfrtp_free_context(PayloadContext *asf) ...@@ -272,7 +272,7 @@ static void asfrtp_free_context(PayloadContext *asf)
{ {
if (asf->pktbuf) { if (asf->pktbuf) {
uint8_t *p = NULL; uint8_t *p = NULL;
url_close_dyn_buf(asf->pktbuf, &p); avio_close_dyn_buf(asf->pktbuf, &p);
asf->pktbuf = NULL; asf->pktbuf = NULL;
av_free(p); av_free(p);
} }
......
...@@ -43,7 +43,7 @@ static void latm_free_context(PayloadContext *data) ...@@ -43,7 +43,7 @@ static void latm_free_context(PayloadContext *data)
return; return;
if (data->dyn_buf) { if (data->dyn_buf) {
uint8_t *p; uint8_t *p;
url_close_dyn_buf(data->dyn_buf, &p); avio_close_dyn_buf(data->dyn_buf, &p);
av_free(p); av_free(p);
} }
av_free(data->buf); av_free(data->buf);
...@@ -60,7 +60,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data, ...@@ -60,7 +60,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data,
if (!data->dyn_buf || data->timestamp != *timestamp) { if (!data->dyn_buf || data->timestamp != *timestamp) {
av_freep(&data->buf); av_freep(&data->buf);
if (data->dyn_buf) if (data->dyn_buf)
url_close_dyn_buf(data->dyn_buf, &data->buf); avio_close_dyn_buf(data->dyn_buf, &data->buf);
data->dyn_buf = NULL; data->dyn_buf = NULL;
av_freep(&data->buf); av_freep(&data->buf);
...@@ -73,7 +73,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data, ...@@ -73,7 +73,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data,
if (!(flags & RTP_FLAG_MARKER)) if (!(flags & RTP_FLAG_MARKER))
return AVERROR(EAGAIN); return AVERROR(EAGAIN);
av_free(data->buf); av_free(data->buf);
data->len = url_close_dyn_buf(data->dyn_buf, &data->buf); data->len = avio_close_dyn_buf(data->dyn_buf, &data->buf);
data->dyn_buf = NULL; data->dyn_buf = NULL;
data->pos = 0; data->pos = 0;
} }
......
...@@ -83,7 +83,7 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv, ...@@ -83,7 +83,7 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv,
if (sv->pktbuf) { if (sv->pktbuf) {
uint8_t *tmp; uint8_t *tmp;
url_close_dyn_buf(sv->pktbuf, &tmp); avio_close_dyn_buf(sv->pktbuf, &tmp);
av_free(tmp); av_free(tmp);
} }
if ((res = avio_open_dyn_buf(&sv->pktbuf)) < 0) if ((res = avio_open_dyn_buf(&sv->pktbuf)) < 0)
...@@ -100,7 +100,7 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv, ...@@ -100,7 +100,7 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv,
av_init_packet(pkt); av_init_packet(pkt);
pkt->stream_index = st->index; pkt->stream_index = st->index;
*timestamp = sv->timestamp; *timestamp = sv->timestamp;
pkt->size = url_close_dyn_buf(sv->pktbuf, &pkt->data); pkt->size = avio_close_dyn_buf(sv->pktbuf, &pkt->data);
pkt->destruct = av_destruct_packet; pkt->destruct = av_destruct_packet;
sv->pktbuf = NULL; sv->pktbuf = NULL;
return 0; return 0;
...@@ -118,7 +118,7 @@ static void svq3_extradata_free(PayloadContext *sv) ...@@ -118,7 +118,7 @@ static void svq3_extradata_free(PayloadContext *sv)
{ {
if (sv->pktbuf) { if (sv->pktbuf) {
uint8_t *buf; uint8_t *buf;
url_close_dyn_buf(sv->pktbuf, &buf); avio_close_dyn_buf(sv->pktbuf, &buf);
av_free(buf); av_free(buf);
} }
av_free(sv); av_free(sv);
......
...@@ -41,7 +41,7 @@ static void prepare_packet(AVPacket *pkt, PayloadContext *vp8, int stream) ...@@ -41,7 +41,7 @@ static void prepare_packet(AVPacket *pkt, PayloadContext *vp8, int stream)
av_init_packet(pkt); av_init_packet(pkt);
pkt->stream_index = stream; pkt->stream_index = stream;
pkt->flags = vp8->is_keyframe ? AV_PKT_FLAG_KEY : 0; pkt->flags = vp8->is_keyframe ? AV_PKT_FLAG_KEY : 0;
pkt->size = url_close_dyn_buf(vp8->data, &pkt->data); pkt->size = avio_close_dyn_buf(vp8->data, &pkt->data);
pkt->destruct = av_destruct_packet; pkt->destruct = av_destruct_packet;
vp8->data = NULL; vp8->data = NULL;
} }
...@@ -138,7 +138,7 @@ static void vp8_free_context(PayloadContext *vp8) ...@@ -138,7 +138,7 @@ static void vp8_free_context(PayloadContext *vp8)
{ {
if (vp8->data) { if (vp8->data) {
uint8_t *tmp; uint8_t *tmp;
url_close_dyn_buf(vp8->data, &tmp); avio_close_dyn_buf(vp8->data, &tmp);
av_free(tmp); av_free(tmp);
} }
av_free(vp8); av_free(vp8);
......
...@@ -57,7 +57,7 @@ static inline void free_fragment_if_needed(PayloadContext * data) ...@@ -57,7 +57,7 @@ static inline void free_fragment_if_needed(PayloadContext * data)
{ {
if (data->fragment) { if (data->fragment) {
uint8_t* p; uint8_t* p;
url_close_dyn_buf(data->fragment, &p); avio_close_dyn_buf(data->fragment, &p);
av_free(p); av_free(p);
data->fragment = NULL; data->fragment = NULL;
} }
...@@ -203,7 +203,7 @@ static int xiph_handle_packet(AVFormatContext * ctx, ...@@ -203,7 +203,7 @@ static int xiph_handle_packet(AVFormatContext * ctx,
if (fragmented == 3) { if (fragmented == 3) {
// end of xiph data packet // end of xiph data packet
av_init_packet(pkt); av_init_packet(pkt);
pkt->size = url_close_dyn_buf(data->fragment, &pkt->data); pkt->size = avio_close_dyn_buf(data->fragment, &pkt->data);
if (pkt->size < 0) { if (pkt->size < 0) {
av_log(ctx, AV_LOG_ERROR, av_log(ctx, AV_LOG_ERROR,
......
...@@ -63,7 +63,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, ...@@ -63,7 +63,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
avio_close(rtpctx->pb); avio_close(rtpctx->pb);
} else { } else {
uint8_t *ptr; uint8_t *ptr;
url_close_dyn_buf(rtpctx->pb, &ptr); avio_close_dyn_buf(rtpctx->pb, &ptr);
av_free(ptr); av_free(ptr);
} }
avformat_free_context(rtpctx); avformat_free_context(rtpctx);
......
...@@ -495,7 +495,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s) ...@@ -495,7 +495,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
av_write_trailer(rtpctx); av_write_trailer(rtpctx);
if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) { if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
uint8_t *ptr; uint8_t *ptr;
url_close_dyn_buf(rtpctx->pb, &ptr); avio_close_dyn_buf(rtpctx->pb, &ptr);
av_free(ptr); av_free(ptr);
} else { } else {
avio_close(rtpctx->pb); avio_close(rtpctx->pb);
......
...@@ -135,7 +135,7 @@ static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st) ...@@ -135,7 +135,7 @@ static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
int size; int size;
uint8_t *interleave_header, *interleaved_packet; uint8_t *interleave_header, *interleaved_packet;
size = url_close_dyn_buf(rtpctx->pb, &buf); size = avio_close_dyn_buf(rtpctx->pb, &buf);
ptr = buf; ptr = buf;
while (size > 4) { while (size > 4) {
uint32_t packet_len = AV_RB32(ptr); uint32_t packet_len = AV_RB32(ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment