<div dir="ltr">
<p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US">Hello,</span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US"></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">If this patch is ok for you, could you please apply it? I have another patch waiting that depends on it (support of multiple formats).</p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US"><span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US"><span>Thank you in advance</span></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US"><span>Best regards</span></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US"><span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US"><span>Farid<br></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span lang="EN-US"><span><br></span></span></p>
</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 8, 2020 at 9:23 PM Farid Hammane <<a href="mailto:farid.hammane@gmail.com" target="_blank">farid.hammane@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The variable 'rate' in aout_sys_t had 18bits, which was<br>
not enough to represent values greater than 262143.<br>
<br>
This patch increases the number of bits reserved for<br>
the sample rate while keeping enough bits for 'channels'<br>
to be able to represent up to 1023;<br>
<br>
This patch also fixes an inconsistency in the number<br>
of supported channels. According to source code, where<br>
channel mapping is configured, amem only supports 8<br>
channels.<br>
<br>
Signed-off-by: Farid Hammane <<a href="mailto:farid.hammane@gmail.com" target="_blank">farid.hammane@gmail.com</a>><br>
---<br>
modules/audio_output/amem.c | 9 +++++----<br>
1 file changed, 5 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/modules/audio_output/amem.c b/modules/audio_output/amem.c<br>
index 0e10a86211..f89b5ec4fe 100644<br>
--- a/modules/audio_output/amem.c<br>
+++ b/modules/audio_output/amem.c<br>
@@ -31,6 +31,7 @@ static int Open (vlc_object_t *);<br>
static void Close (vlc_object_t *);<br>
<br>
#define AMEM_SAMPLE_RATE_MAX 384000<br>
+#define AMEM_CHAN_MAX 8<br>
<br>
vlc_module_begin ()<br>
set_shortname (N_("Audio memory"))<br>
@@ -49,7 +50,7 @@ vlc_module_begin ()<br>
change_private()<br>
add_integer ("amem-channels", 2,<br>
N_("Channels count"), N_("Channels count"), false)<br>
- change_integer_range (1, AOUT_CHAN_MAX)<br>
+ change_integer_range (1, AMEM_CHAN_MAX)<br>
change_private()<br>
<br>
vlc_module_end ()<br>
@@ -67,8 +68,8 @@ typedef struct<br>
};<br>
struct<br>
{<br>
- unsigned rate:18;<br>
- unsigned channels:14;<br>
+ unsigned rate:22;<br>
+ unsigned channels:10;<br>
};<br>
};<br>
void (*play) (void *opaque, const void *data, unsigned count, int64_t pts);<br>
@@ -229,7 +230,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *fmt)<br>
<br>
/* Ensure that format is supported */<br>
if (fmt->i_rate == 0 || fmt->i_rate > AMEM_SAMPLE_RATE_MAX<br>
- || channels == 0 || channels > AOUT_CHAN_MAX<br>
+ || channels == 0 || channels > AMEM_CHAN_MAX<br>
|| strcmp(format, "S16N") /* TODO: amem-format */)<br>
{<br>
msg_Err (aout, "format not supported: %s, %u channel(s), %u Hz",<br>
-- <br>
2.20.1<br>
<br>
</blockquote></div>