summaryrefslogtreecommitdiff
path: root/libavformat/asfenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-02 15:41:20 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-07 00:41:45 +0200
commit7001ff74ba7fb5035f412a8be17d97b165f0ac5f (patch)
treead75b7f777ec672c834ce1860ec25afbe455e43b /libavformat/asfenc.c
parent5869407da2657900ebf7419a4dff85b309e2363e (diff)
avformat/aviobuf: Add ffio_init_(read|write)_context()
Most users of ffio_init_context() simply want to wrap a buffer into an AVIOContext; they do not provide function pointers at all. Therefore this commit adds shortcuts for these two common operations. This also allows to accept const data when reading (i.e. the const is now cast away at a central place in ffio_init_read_context() instead of at several callers). This also allows to constify the data in ff_text_init_buf(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/asfenc.c')
-rw-r--r--libavformat/asfenc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 244c7e7a27..2f2d9b1bab 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -773,8 +773,7 @@ static int asf_write_header(AVFormatContext *s)
asf->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1;
asf->packet_timestamp_end = -1;
- ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,
- NULL, NULL, NULL, NULL);
+ ffio_init_write_context(&asf->pb, asf->packet_buf, s->packet_size);
if (s->avoid_negative_ts < 0)
s->avoid_negative_ts = 1;
@@ -866,8 +865,7 @@ static void flush_packet(AVFormatContext *s)
asf->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1;
asf->packet_timestamp_end = -1;
- ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,
- NULL, NULL, NULL, NULL);
+ ffio_init_write_context(&asf->pb, asf->packet_buf, s->packet_size);
}
static void put_payload_header(AVFormatContext *s, ASFStream *stream,