Unified · Split
| @@ -299,7 +299,7 @@ getduration(Tagctx *ctx, int offset) · 298 unmodified lines | |||
| 299 | uint x; | 299 | uint x; |
| 300 | int xversion, xlayer, xbitrate; | 300 | int xversion, xlayer, xbitrate; |
| 301 | 301 | ||
| 302 | if(ctx->read(ctx, ctx->buf, 64) != 64) | 302 | if(ctx->read(ctx, ctx->buf, 256) != 256) |
| 303 | return; | 303 | return; |
| 304 | 304 | ||
| 305 | x = beuint((uchar*)ctx->buf); | 305 | x = beuint((uchar*)ctx->buf); |
| @@ -325,9 +325,14 @@ getduration(Tagctx *ctx, int offset) · 19 unmodified lines | |||
| 325 | ctx->duration = n * samplespf * 1000 / ctx->samplerate; | 325 | ctx->duration = n * samplespf * 1000 / ctx->samplerate; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | if(ctx->duration == 0 && (x & 2) != 0 && framelen > 0){ /* file size is set */ | 328 | if((x & 2) != 0){ /* file size is set */ |
| 329 | n = beuint(b); | 329 | n = beuint(b); b += 4; |
| 330 | ctx->duration = n * samplespf * 1000 / framelen / ctx->samplerate; | 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 | } | ||
| 331 | } | 336 | } |
| 332 | }else if(memcmp(&ctx->buf[0x24], "VBRI", 4) == 0){ | 337 | }else if(memcmp(&ctx->buf[0x24], "VBRI", 4) == 0){ |
| 333 | n = beuint((uchar*)&ctx->buf[0x32]); | 338 | n = beuint((uchar*)&ctx->buf[0x32]); |