mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 18:09:59 +00:00
mpeg: Heed dataoffset to avoid passing RIFF header when reading from pipes.
This commit is contained in:
parent
1a5d40cf21
commit
294eb05633
@ -548,7 +548,6 @@ mpeg_decoder_init (SF_PRIVATE *psf)
|
|||||||
mpg123_param (pmp3d->pmh, MPG123_ADD_FLAGS, MPG123_NO_FRANKENSTEIN, 1.0) ;
|
mpg123_param (pmp3d->pmh, MPG123_ADD_FLAGS, MPG123_NO_FRANKENSTEIN, 1.0) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
psf->dataoffset = 0 ;
|
|
||||||
/*
|
/*
|
||||||
** Need to pass the first MPEG frame to libmpg123, but that frame was read
|
** Need to pass the first MPEG frame to libmpg123, but that frame was read
|
||||||
** into psf->binheader in order that we could identify the stream.
|
** into psf->binheader in order that we could identify the stream.
|
||||||
@ -558,8 +557,8 @@ mpeg_decoder_init (SF_PRIVATE *psf)
|
|||||||
** Can't seek, so setup our libmpg123 io callbacks to read the binheader
|
** Can't seek, so setup our libmpg123 io callbacks to read the binheader
|
||||||
** buffer first.
|
** buffer first.
|
||||||
*/
|
*/
|
||||||
psf_binheader_readf (psf, "p", 0) ;
|
psf_binheader_readf (psf, "p", psf->dataoffset) ;
|
||||||
pmp3d->header_remaining = psf_binheader_readf (psf, NULL) ;
|
pmp3d->header_remaining = psf_binheader_readf (psf, NULL) - psf->dataoffset ;
|
||||||
|
|
||||||
/* Tell libmpg123 we can't seek the file. */
|
/* Tell libmpg123 we can't seek the file. */
|
||||||
mpg123_param (pmp3d->pmh, MPG123_ADD_FLAGS, MPG123_NO_PEEK_END, 1.0) ;
|
mpg123_param (pmp3d->pmh, MPG123_ADD_FLAGS, MPG123_NO_PEEK_END, 1.0) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user