History

id3v2: add a note for possibly reading TOC in the future

Sigrid Solveig Haflínudóttir committed 6 years ago

Commit 17e82bf1 parent ff132df1 file · +9 −4Browse files

Unified · Split

id3v2.c+9−4
@@ -299,7 +299,7 @@ getduration(Tagctx *ctx, int offset) · 298 unmodified lines
299299 uint x;
300300 int xversion, xlayer, xbitrate;
301301
302− if(ctx->read(ctx, ctx->buf, 64) != 64)
302+ if(ctx->read(ctx, ctx->buf, 256) != 256)
303303 return;
304304
305305 x = beuint((uchar*)ctx->buf);
@@ -325,9 +325,14 @@ getduration(Tagctx *ctx, int offset) · 19 unmodified lines
325325 ctx->duration = n * samplespf * 1000 / ctx->samplerate;
326326 }
327327
328− if(ctx->duration == 0 && (x & 2) != 0 && framelen > 0){ /* file size is set */
329− n = beuint(b);
330− ctx->duration = n * samplespf * 1000 / framelen / ctx->samplerate;
328+ if((x & 2) != 0){ /* file size is set */
329+ n = beuint(b); b += 4;
330+ if(ctx->duration == 0 && framelen > 0)
331+ ctx->duration = n * samplespf * 1000 / framelen / ctx->samplerate;
332+
333+ if((x & 4) != 0){ /* TOC is set */
334+ /* not doing anything yet */
335+ }
331336 }
332337 }else if(memcmp(&ctx->buf[0x24], "VBRI", 4) == 0){
333338 n = beuint((uchar*)&ctx->buf[0x32]);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t