1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-15 11:31:02 +00:00

stream: fix typos in a comments

This commit is contained in:
wm4 2019-11-07 14:49:41 +01:00
parent 12d1761064
commit 53f17a71f4
2 changed files with 4 additions and 4 deletions

View File

@ -203,7 +203,7 @@ static const char *match_proto(const char *url, const char *proto)
}
// Read len bytes from the start position, and wrap around as needed. Limit the
// a actually read data to the size of the buffer. Return amount of copied bytes.
// actually read data to the size of the buffer. Return amount of copied bytes.
// len: max bytes to copy to dst
// pos: index into s->buffer[], e.g. s->buf_start is byte 0
// returns: bytes copied to dst (limited by len and available buffered data)

View File

@ -152,7 +152,7 @@ typedef struct stream {
// This is a ring buffer. It is reset only on seeks (or when buffers are
// dropped). Otherwise old contents always stay valid.
// The valid buffer is from buf_start to buf_end; buf_end can be larger
// then the buffer size (requires wrap around). buf_cur is a value in the
// than the buffer size (requires wrap around). buf_cur is a value in the
// range [buf_start, buf_end].
// When reading more data from the stream, buf_start is advanced as old
// data is overwritten with new data.
@ -164,7 +164,7 @@ typedef struct stream {
// ^ buf_start (4) | |
// | ^ buf_end (12 % 8 => 4)
// ^ buf_cur (9 % 8 => 1)
// Here, the entire 8 byte buffer is filled, i.e. buf_end - buf_start = 8.
// Here, the entire 8 byte buffer is filled, i.e. buf_end - buf_start = 8.
// buffer_mask == 7, so (x & buffer_mask) == (x % buffer_size)
unsigned int buf_start; // index of oldest byte in buffer (is <= buffer_mask)
unsigned int buf_cur; // current read pos (can be > buffer_mask)
@ -174,7 +174,7 @@ typedef struct stream {
uint8_t *buffer;
} stream_t;
// Non-inline version with stream_read_char().
// Non-inline version of stream_read_char().
int stream_read_char_fallback(stream_t *s);
int stream_write_buffer(stream_t *s, unsigned char *buf, int len);