mirror of
https://github.com/openharmony/third_party_minimp3.git
synced 2026-07-01 10:05:26 -04:00
get samples_per_frame from hdr_frame_samples
Signed-off-by: zhangtl <tongliangzhang@bestechnic.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int frame_bytes, frame_offset, channels, hz, layer, bitrate_kbps;
|
||||
int frame_bytes, frame_offset, channels, hz, layer, bitrate_kbps, samples_per_frame;
|
||||
} mp3dec_frame_info_t;
|
||||
|
||||
typedef struct
|
||||
@@ -890,13 +890,6 @@ static void L3_midside_stereo(float *left, int n)
|
||||
VSTORE(left + i, VADD(vl, vr));
|
||||
VSTORE(right + i, VSUB(vl, vr));
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
/* Workaround for spurious -Waggressive-loop-optimizations warning from gcc.
|
||||
* For more info see: https://github.com/lieff/minimp3/issues/88
|
||||
*/
|
||||
if (__builtin_constant_p(n % 4 == 0) && n % 4 == 0)
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_SIMD */
|
||||
for (; i < n; i++)
|
||||
|
||||
Regular → Executable
+3
-3
@@ -503,8 +503,6 @@ int mp3dec_iterate_buf(const uint8_t *buf, size_t buf_size, MP3D_ITERATE_CB call
|
||||
return MP3D_E_PARAM;
|
||||
/* skip id3 */
|
||||
mp3dec_skip_id3(&buf, &buf_size);
|
||||
if (!buf_size)
|
||||
return 0;
|
||||
mp3dec_frame_info_t frame_info;
|
||||
memset(&frame_info, 0, sizeof(frame_info));
|
||||
do
|
||||
@@ -523,11 +521,13 @@ int mp3dec_iterate_buf(const uint8_t *buf, size_t buf_size, MP3D_ITERATE_CB call
|
||||
frame_info.layer = 4 - HDR_GET_LAYER(hdr);
|
||||
frame_info.bitrate_kbps = hdr_bitrate_kbps(hdr);
|
||||
frame_info.frame_bytes = frame_size;
|
||||
frame_info.samples_per_frame = hdr_frame_samples(hdr);
|
||||
|
||||
if (callback)
|
||||
{
|
||||
if ((ret = callback(user_data, hdr, frame_size, free_format_bytes, buf_size, hdr - orig_buf, &frame_info)))
|
||||
if ((ret = callback(user_data, hdr, frame_size, free_format_bytes, buf_size, hdr - orig_buf, &frame_info))){
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
buf += frame_size;
|
||||
buf_size -= frame_size;
|
||||
|
||||
Reference in New Issue
Block a user