mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-20 20:41:08 +01:00
Use free_mpeg to close MPEG internals
This commit is contained in:
parent
df84602e85
commit
6b99cf8f72
@ -1,10 +1,9 @@
|
||||
#include "../vgmstream.h"
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
#include "../util.h"
|
||||
|
||||
#ifdef VGM_USE_MPEG
|
||||
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* AHX is a CRI format which contains an MPEG-2 Layer 2 audio stream.
|
||||
* Although the MPEG frame headers are incorrect... */
|
||||
|
||||
@ -45,7 +44,7 @@ VGMSTREAM * init_vgmstream_ahx(STREAMFILE *streamFile) {
|
||||
/* check channel count (only mono AHXs are known) */
|
||||
if (read_8bit(7,streamFile) != 1) goto fail;
|
||||
|
||||
/* At this point we almost certainly have an ADX file,
|
||||
/* At this point we almost certainly have an AHX file,
|
||||
* so let's build the VGMSTREAM. */
|
||||
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
@ -103,15 +102,10 @@ VGMSTREAM * init_vgmstream_ahx(STREAMFILE *streamFile) {
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (data) {
|
||||
if (data->m) {
|
||||
mpg123_delete(data->m);
|
||||
data->m = NULL;
|
||||
}
|
||||
free(data);
|
||||
data = NULL;
|
||||
}
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
free_mpeg(data);
|
||||
if (vgmstream) vgmstream->codec_data = NULL;
|
||||
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ VGMSTREAM * init_vgmstream_ps3_xvag(STREAMFILE *streamFile) {
|
||||
#ifdef VGM_USE_MPEG
|
||||
else if(vgmstream->layout_type == layout_mpeg) {
|
||||
for (i=0;i<channel_count;i++) {
|
||||
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,MPEG_BUFFER_SIZE);
|
||||
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
vgmstream->ch[i].channel_start_offset= vgmstream->ch[i].offset=start_offset;
|
||||
}
|
||||
|
||||
@ -216,14 +216,8 @@ VGMSTREAM * init_vgmstream_ps3_xvag(STREAMFILE *streamFile) {
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
#ifdef VGM_USE_MPEG
|
||||
if (mpeg_data) {
|
||||
mpg123_delete(mpeg_data->m);
|
||||
free(mpeg_data);
|
||||
|
||||
if (vgmstream) {
|
||||
vgmstream->codec_data = NULL;
|
||||
}
|
||||
}
|
||||
free_mpeg(mpeg_data);
|
||||
if (vgmstream) vgmstream->codec_data = NULL;
|
||||
#endif
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user