diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-02 15:41:20 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-07 00:41:45 +0200 |
commit | 7001ff74ba7fb5035f412a8be17d97b165f0ac5f (patch) | |
tree | ad75b7f777ec672c834ce1860ec25afbe455e43b /libavformat/id3v2.c | |
parent | 5869407da2657900ebf7419a4dff85b309e2363e (diff) | |
download | ffmpeg-7001ff74ba7fb5035f412a8be17d97b165f0ac5f.tar.gz |
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/id3v2.c')
-rw-r--r-- | libavformat/id3v2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 69193933e0..d83716dcf4 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -1001,8 +1001,7 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata, t++; } - ffio_init_context(&pb_local, buffer, b - buffer, 0, NULL, NULL, NULL, - NULL); + ffio_init_read_context(&pb_local, buffer, b - buffer); tlen = b - buffer; pbx = &pb_local.pub; // read from sync buffer } @@ -1038,7 +1037,7 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata, av_log(s, AV_LOG_ERROR, "Failed to uncompress tag: %d\n", err); goto seek; } - ffio_init_context(&pb_local, uncompressed_buffer, dlen, 0, NULL, NULL, NULL, NULL); + ffio_init_read_context(&pb_local, uncompressed_buffer, dlen); tlen = dlen; pbx = &pb_local.pub; // read from sync buffer } |