MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / mad_stream_sync

Function mad_stream_sync

modules/data/mp3/libmad/stream.c:107–125  ·  view source on GitHub ↗

* NAME: stream->sync() * DESCRIPTION: locate the next stream sync word */

Source from the content-addressed store, hash-verified

105 * DESCRIPTION: locate the next stream sync word
106 */
107int mad_stream_sync(struct mad_stream *stream)
108{
109 register unsigned char const *ptr, *end;
110stack(__FUNCTION__, __FILE__, __LINE__);
111
112 ptr = mad_bit_nextbyte(&stream->ptr);
113 end = stream->bufend;
114
115 while (ptr < end - 1 &&
116 !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0))
117 ++ptr;
118
119 if (end - ptr < MAD_BUFFER_GUARD)
120 return -1;
121
122 mad_bit_init(&stream->ptr, ptr);
123
124 return 0;
125}
126
127/*
128 * NAME: stream->errorstr()

Callers 2

free_bitrateFunction · 0.85
mad_header_decodeFunction · 0.85

Calls 2

mad_bit_nextbyteFunction · 0.85
mad_bit_initFunction · 0.85

Tested by

no test coverage detected