Commit 7d5fe81e authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix audio format merge logic

Detail:
  c/ScrModes - When removing 'candidate' from the list of audio formats, it's the number of formats which we want to decrement, not the pointer to the start of the list.
Admin:
  Tested on iMx6
  Fixes "RMA allocation failed" and other issues when dealing with monitors with complex audio capabilities


Version 0.51. Tagged as 'ScrModes-0_51'
parent eeb8be91
/* (0.50) /* (0.51)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.50 #define Module_MajorVersion_CMHG 0.51
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 15 Dec 2015 #define Module_Date_CMHG 06 Jan 2016
#define Module_MajorVersion "0.50" #define Module_MajorVersion "0.51"
#define Module_Version 50 #define Module_Version 51
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "15 Dec 2015" #define Module_Date "06 Jan 2016"
#define Module_ApplicationDate "15-Dec-15" #define Module_ApplicationDate "06-Jan-16"
#define Module_ComponentName "ScrModes" #define Module_ComponentName "ScrModes"
#define Module_ComponentPath "castle/RiscOS/Sources/Video/UserI/ScrModes" #define Module_ComponentPath "castle/RiscOS/Sources/Video/UserI/ScrModes"
#define Module_FullVersion "0.50" #define Module_FullVersion "0.51"
#define Module_HelpVersion "0.50 (15 Dec 2015)" #define Module_HelpVersion "0.51 (06 Jan 2016)"
#define Module_LibraryVersionInfo "0:50" #define Module_LibraryVersionInfo "0:51"
...@@ -2652,7 +2652,7 @@ static _kernel_oserror *add_audio_format(uint8_t byte1, uint8_t byte2, uint8_t b ...@@ -2652,7 +2652,7 @@ static _kernel_oserror *add_audio_format(uint8_t byte1, uint8_t byte2, uint8_t b
if (!candidate->sample_rates) if (!candidate->sample_rates)
{ {
/* Candidate can be removed completely */ /* Candidate can be removed completely */
new_monitor->audio_formats--; new_monitor->audio_format_count--;
memmove(candidate, candidate+1, sizeof(AudioFormat)*(new_monitor->audio_format_count-i)); memmove(candidate, candidate+1, sizeof(AudioFormat)*(new_monitor->audio_format_count-i));
void *new = realloc(new_monitor->audio_formats, new_monitor->audio_format_count*sizeof(AudioFormat)); void *new = realloc(new_monitor->audio_formats, new_monitor->audio_format_count*sizeof(AudioFormat));
if (new) if (new)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment