]> git.alsa-project.org Git - tinycompress.git/commit
utils: cplay: Reset file cursor after MP3 header parse
authorLaurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Fri, 26 Aug 2022 08:52:38 +0000 (11:52 +0300)
committerVinod Koul <3178504+vinodkoul@users.noreply.github.com>
Mon, 19 Sep 2022 08:56:18 +0000 (14:26 +0530)
commitf9fe0e3e0cc21b9550d30850fb06f68aeabc9337
tree5476870c3558c6f0638d19d735c18775464fb545
parente3edd98993f0710043381d71cf3c0bf497b0ebb1
utils: cplay: Reset file cursor after MP3 header parse

We need to reset the file cursor to the beginning of the file.

Initially, the program would simply get stuck polling the
compress fd. This was probably because of the fact that the
codec would hang because of the fact that it was expecting
to receive the MP3 data along with its associated MP3 header.

This was not the case for the first (header, data) pair because,
after parsing the first header, the file cursor would point
at the beginning of the data region.

By resetting the file cursor to the beginning of the file,
the codec will receive all the (header, data) pairs it
actually expects.

Suggested-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
src/utils/cplay.c