mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-30 17:24:31 +01:00
Merge pull request #1546 from bnnm/txth-hca
- Fix TXTH samples for mono MS-IMA/MSADPCM - Add HCA key
This commit is contained in:
commit
4f88db173b
@ -1314,6 +1314,9 @@ static const hcakey_info hcakey_list[] = {
|
||||
// Sonic Rumble (Android)
|
||||
{6834182874188563}, // 001847A7328BCB13
|
||||
|
||||
// P A Certain Magical Index 2 (Android)
|
||||
{5963}, // 000000000000174B
|
||||
|
||||
};
|
||||
|
||||
#endif/*_HCA_KEYS_H_*/
|
||||
|
@ -2155,6 +2155,8 @@ fail:
|
||||
static int get_bytes_to_samples(txth_header* txth, uint32_t bytes) {
|
||||
switch(txth->codec) {
|
||||
case MS_IMA:
|
||||
if (txth->interleave && txth->frame_size) /* mono mode */ //TODO maybe some helper instead
|
||||
return ms_ima_bytes_to_samples(bytes / txth->channels, txth->frame_size, 1);
|
||||
return ms_ima_bytes_to_samples(bytes, txth->frame_size ? txth->frame_size : txth->interleave, txth->channels);
|
||||
case XBOX:
|
||||
return xbox_ima_bytes_to_samples(bytes, txth->channels);
|
||||
@ -2185,6 +2187,8 @@ static int get_bytes_to_samples(txth_header* txth, uint32_t bytes) {
|
||||
case TGC:
|
||||
return pcm_bytes_to_samples(bytes, txth->channels, 4);
|
||||
case MSADPCM:
|
||||
if (txth->interleave && txth->frame_size) /* mono mode */ //TODO some helper instead
|
||||
return msadpcm_bytes_to_samples(bytes / txth->channels, txth->frame_size, 1);
|
||||
return msadpcm_bytes_to_samples(bytes, txth->frame_size ? txth->frame_size : txth->interleave, txth->channels);
|
||||
case ATRAC3:
|
||||
return atrac3_bytes_to_samples(bytes, txth->frame_size ? txth->frame_size : txth->interleave);
|
||||
|
Loading…
Reference in New Issue
Block a user