Commit fab34784 authored by Martin Storsjö's avatar Martin Storsjö

omxil: Make sure i_channels is nonzero before dividing by it

At startup of the decoder, i_channels might be set to 0 if the decoder
hasn't processed the sent CODECCONFIG data yet. (In these cases, the
returned buffers are 0 bytes long so we don't miss anything either.)
A port reconfigure event is sent in these cases, so i_channels gets
initialized to the right value before we handle any later buffers with
actual content.
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 4edfa4f5
...@@ -1513,11 +1513,12 @@ block_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block ) ...@@ -1513,11 +1513,12 @@ block_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
/* Take care of decoded frames first */ /* Take care of decoded frames first */
while(!p_buffer) while(!p_buffer)
{ {
unsigned int i_samples; unsigned int i_samples = 0;
OMX_FIFO_PEEK(&p_sys->out.fifo, p_header); OMX_FIFO_PEEK(&p_sys->out.fifo, p_header);
if(!p_header) break; /* No frame available */ if(!p_header) break; /* No frame available */
if (p_sys->out.p_fmt->audio.i_channels)
i_samples = p_header->nFilledLen / p_sys->out.p_fmt->audio.i_channels / 2; i_samples = p_header->nFilledLen / p_sys->out.p_fmt->audio.i_channels / 2;
if(i_samples) if(i_samples)
{ {
......
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