Skip to content

Commit

Permalink
avio: deprecate url_open_buf
Browse files Browse the repository at this point in the history
It's only used in one place and does the same thing as
avio_alloc_context.

Signed-off-by: Ronald S. Bultje <[email protected]>
  • Loading branch information
elenril authored and rbultje committed Mar 17, 2011
1 parent eda4cf9 commit 83fddae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ffserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,8 @@ static int http_receive_data(HTTPContext *c)
if (!fmt_in)
goto fail;

url_open_buf(&pb, c->buffer, c->buffer_end - c->buffer, URL_RDONLY);
pb = avio_alloc_context(c->buffer, c->buffer_end - c->buffer,
0, NULL, NULL, NULL, NULL);
pb->is_streamed = 1;

if (av_open_input_stream(&s, pb, c->stream->feed_filename, fmt_in, NULL) < 0) {
Expand Down
4 changes: 2 additions & 2 deletions libavformat/avio.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,9 @@ URLContext *url_fileno(AVIOContext *s);
* @deprecated use AVIOContext.max_packet_size directly.
*/
attribute_deprecated int url_fget_max_packet_size(AVIOContext *s);
#endif

int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
#endif

/** return the written or read size */
int url_close_buf(AVIOContext *s);
Expand Down
2 changes: 2 additions & 0 deletions libavformat/aviobuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ int64_t av_url_read_fseek(AVIOContext *s, int stream_index,
* back to the server even if CONFIG_MUXERS is false. */
#if CONFIG_MUXERS || CONFIG_NETWORK
/* buffer handling */
#if FF_API_OLD_AVIO
int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags)
{
int ret;
Expand All @@ -1009,6 +1010,7 @@ int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags)
av_freep(s);
return ret;
}
#endif

int url_close_buf(AVIOContext *s)
{
Expand Down

0 comments on commit 83fddae

Please sign in to comment.