shithub: mp3dec

Download patch

ref: 682006f91a95058ad3927b46c7d99df1d674d3e1
parent: 1f217bc6153f59bbe47de84dd6989ea3afb9f582
author: lieff <[email protected]>
date: Wed Feb 12 12:41:14 EST 2020

pass frame offset in mp3dec_frame_info_t

--- a/minimp3.h
+++ b/minimp3.h
@@ -12,7 +12,7 @@
 
 typedef struct
 {
-    int frame_bytes, channels, hz, layer, bitrate_kbps;
+    int frame_bytes, frame_offset, channels, hz, layer, bitrate_kbps;
 } mp3dec_frame_info_t;
 
 typedef struct
@@ -1711,6 +1711,7 @@
     hdr = mp3 + i;
     memcpy(dec->header, hdr, HDR_SIZE);
     info->frame_bytes = i + frame_size;
+    info->frame_offset = i;
     info->channels = HDR_IS_MONO(hdr) ? 1 : 2;
     info->hz = hdr_sample_rate_hz(hdr);
     info->layer = 4 - HDR_GET_LAYER(hdr);