MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / copy_tag

Function copy_tag

tools/ismindex.c:108–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static int copy_tag(AVIOContext *in, AVIOContext *out, int32_t tag_name)
109{
110 int32_t size, tag;
111
112 size = avio_rb32(in);
113 tag = avio_rb32(in);
114 avio_wb32(out, size);
115 avio_wb32(out, tag);
116 if (expect_tag(tag, tag_name) != 0)
117 return -1;
118 size -= 8;
119 while (size > 0) {
120 char buf[1024];
121 int len = FFMIN(sizeof(buf), size);
122 int got;
123 if ((got = avio_read(in, buf, len)) != len) {
124 fprintf(stderr, "short read, wanted %d, got %d\n", len, got);
125 break;
126 }
127 avio_write(out, buf, len);
128 size -= len;
129 }
130 return 0;
131}
132
133static int skip_tag(AVIOContext *in, int32_t tag_name)
134{

Callers 1

write_fragmentFunction · 0.85

Calls 5

avio_rb32Function · 0.85
avio_wb32Function · 0.85
expect_tagFunction · 0.85
avio_readFunction · 0.85
avio_writeFunction · 0.85

Tested by

no test coverage detected