mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +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) ;
|
||||
#endif
|
||||
|
||||
psf->dataoffset = 0 ;
|
||||
/*
|
||||
** 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.
|
||||
@ -558,8 +557,8 @@ mpeg_decoder_init (SF_PRIVATE *psf)
|
||||
** Can't seek, so setup our libmpg123 io callbacks to read the binheader
|
||||
** buffer first.
|
||||
*/
|
||||
psf_binheader_readf (psf, "p", 0) ;
|
||||
pmp3d->header_remaining = psf_binheader_readf (psf, NULL) ;
|
||||
psf_binheader_readf (psf, "p", psf->dataoffset) ;
|
||||
pmp3d->header_remaining = psf_binheader_readf (psf, NULL) - psf->dataoffset ;
|
||||
|
||||
/* Tell libmpg123 we can't seek the file. */
|
||||
mpg123_param (pmp3d->pmh, MPG123_ADD_FLAGS, MPG123_NO_PEEK_END, 1.0) ;
|
||||
|
Loading…
Reference in New Issue
Block a user