浏览代码

stb_vorbis: Clarify lifetime of pushdata *output buffers

Fixes issue #929.
Fabian Giesen 4 年之前
父节点
当前提交
39a0641385
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      stb_vorbis.c

+ 6 - 0
stb_vorbis.c

@@ -223,6 +223,12 @@ extern int stb_vorbis_decode_frame_pushdata(
 // channel. In other words, (*output)[0][0] contains the first sample from
 // the first channel, and (*output)[1][0] contains the first sample from
 // the second channel.
+//
+// *output points into stb_vorbis's internal output buffer storage; these
+// buffers are owned by stb_vorbis and application code should not free
+// them or modify their contents. They are transient and will be overwritten
+// once you ask for more data to get decoded, so be sure to grab any data
+// you need before then.
 
 extern void stb_vorbis_flush_pushdata(stb_vorbis *f);
 // inform stb_vorbis that your next datablock will not be contiguous with