Changeset 703 for GPL/trunk/alsa-kernel/synth/emux/soundfont.c
- Timestamp:
- Sep 26, 2021, 6:18:40 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-next merged: 696-702
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/synth/emux/soundfont.c
r679 r703 109 109 * although it was designed for the AWE64. 110 110 * 111 * The sample_write and callargs para rameters allow a callback into111 * The sample_write and callargs parameters allow a callback into 112 112 * the actual driver to write sample data to the board or whatever 113 113 * it wants to do with it. … … 350 350 struct snd_sf_zone *zp; 351 351 352 if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL) 352 zp = kzalloc(sizeof(*zp), GFP_KERNEL); 353 if (!zp) 353 354 return NULL; 354 355 zp->next = sf->zones; … … 382 383 struct snd_sf_sample *sp; 383 384 384 if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL) 385 sp = kzalloc(sizeof(*sp), GFP_KERNEL); 386 if (!sp) 385 387 return NULL; 386 388 … … 452 454 453 455 /* create a new zone */ 454 if ((zp = sf_zone_new(sflist, sf)) == NULL) 456 zp = sf_zone_new(sflist, sf); 457 if (!zp) 455 458 return -ENOMEM; 456 459 … … 515 518 516 519 /* patch must be opened */ 517 if ((sf = sflist->currsf) == NULL) 520 sf = sflist->currsf; 521 if (!sf) 518 522 return -EINVAL; 519 523 … … 582 586 583 587 /* create a new zone */ 584 if ((zone = sf_zone_new(sflist, sf)) == NULL) { 588 zone = sf_zone_new(sflist, sf); 589 if (!zone) 585 590 return -ENOMEM; 586 }587 591 588 592 /* copy the temporary data */ … … 703 707 704 708 /* patch must be opened */ 705 if ((sf = sflist->currsf) == NULL) 709 sf = sflist->currsf; 710 if (!sf) 706 711 return -EINVAL; 707 712 … … 726 731 727 732 /* Allocate a new sample structure */ 728 if ((sp = sf_sample_new(sflist, sf)) == NULL) 733 sp = sf_sample_new(sflist, sf); 734 if (!sp) 729 735 return -ENOMEM; 730 736 … … 796 802 s = (amount >> 24) & 0x7f; 797 803 low = (amount >> 16) & 0xff; 798 /* linear approx mimation by lower 8 bit */804 /* linear approximation by lower 8 bit */ 799 805 v = (log_tbl[s + 1] * low + log_tbl[s] * (0x100 - low)) >> 8; 800 806 v -= offset; … … 961 967 if (sf == NULL) 962 968 return -ENOMEM; 963 if ((smp = sf_sample_new(sflist, sf)) == NULL) 969 smp = sf_sample_new(sflist, sf); 970 if (!smp) 964 971 return -ENOMEM; 965 972 sample_id = sflist->sample_counter; … … 999 1006 1000 1007 /* set up voice info */ 1001 if ((zone = sf_zone_new(sflist, sf)) == NULL) { 1008 zone = sf_zone_new(sflist, sf); 1009 if (!zone) { 1002 1010 sf_sample_delete(sflist, sf, smp); 1003 1011 return -ENOMEM; … … 1184 1192 1185 1193 /* prepend this zone */ 1186 if ((index = get_index(cur->bank, cur->instr, cur->v.low)) < 0) 1194 index = get_index(cur->bank, cur->instr, cur->v.low); 1195 if (index < 0) 1187 1196 return; 1188 1197 cur->next_zone = zone; /* zone link */ … … 1200 1209 struct snd_sf_zone *p; 1201 1210 1202 if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0) 1211 index = get_index(zp->bank, zp->instr, zp->v.low); 1212 if (index < 0) 1203 1213 return; 1204 1214 for (p = sflist->presets[index]; p; p = p->next_instr) { … … 1260 1270 struct snd_sf_zone *zp; 1261 1271 1262 if ((index = get_index(bank, preset, key)) < 0) 1272 index = get_index(bank, preset, key); 1273 if (index < 0) 1263 1274 return NULL; 1264 1275 for (zp = sflist->presets[index]; zp; zp = zp->next_instr) { … … 1389 1400 struct snd_sf_list *sflist; 1390 1401 1391 if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL) 1402 sflist = kzalloc(sizeof(*sflist), GFP_KERNEL); 1403 if (!sflist) 1392 1404 return NULL; 1393 1405 … … 1424 1436 /* 1425 1437 * Remove all samples 1426 * The soundcard should be sile t before calling this function.1438 * The soundcard should be silent before calling this function. 1427 1439 */ 1428 1440 int
Note:
See TracChangeset
for help on using the changeset viewer.