Unified · Split
| @@ -83,11 +83,12 @@ tagopus(Tagctx *ctx) · 82 unmodified lines | |||
| 83 | if(v != nil && v[1] == 'g' && v[2] == 'g' && v[3] == 'S'){ | 83 | if(v != nil && v[1] == 'g' && v[2] == 'g' && v[3] == 'S'){ |
| 84 | uvlong g = leuint(v+6) | (uvlong)leuint(v+10)<<32; | 84 | uvlong g = leuint(v+6) | (uvlong)leuint(v+10)<<32; |
| 85 | ctx->duration = g * 1000 / 48000; /* granule positions are always 48KHz */ | 85 | ctx->duration = g * 1000 / 48000; /* granule positions are always 48KHz */ |
| 86 | return 0; | ||
| 87 | } | 86 | } |
| 88 | if(v != nil) | 87 | if(v != nil) |
| 89 | v++; | 88 | v++; |
| 90 | } | 89 | } |
| 90 | if(ctx->duration != 0) | ||
| 91 | break; | ||
| 91 | } | 92 | } |
| 92 | } | 93 | } |
| 93 | 94 | ||
| @@ -119,11 +119,12 @@ tagvorbis(Tagctx *ctx) · 118 unmodified lines | |||
| 119 | if(v != nil && v[1] == 'g' && v[2] == 'g' && v[3] == 'S' && (v[5] & 4) == 4){ /* last page */ | 119 | if(v != nil && v[1] == 'g' && v[2] == 'g' && v[3] == 'S' && (v[5] & 4) == 4){ /* last page */ |
| 120 | uvlong g = leuint(v+6) | (uvlong)leuint(v+10)<<32; | 120 | uvlong g = leuint(v+6) | (uvlong)leuint(v+10)<<32; |
| 121 | ctx->duration = g * 1000 / ctx->samplerate; | 121 | ctx->duration = g * 1000 / ctx->samplerate; |
| 122 | return 0; | ||
| 123 | } | 122 | } |
| 124 | if(v != nil) | 123 | if(v != nil) |
| 125 | v++; | 124 | v++; |
| 126 | } | 125 | } |
| 126 | if(ctx->duration != 0) | ||
| 127 | break; | ||
| 127 | } | 128 | } |
| 128 | } | 129 | } |
| 129 | 130 | ||