mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-21 20:59:52 +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
|
#ifdef VGM_USE_MPEG
|
||||||
|
|
||||||
#include "meta.h"
|
|
||||||
#include "../util.h"
|
|
||||||
|
|
||||||
/* AHX is a CRI format which contains an MPEG-2 Layer 2 audio stream.
|
/* AHX is a CRI format which contains an MPEG-2 Layer 2 audio stream.
|
||||||
* Although the MPEG frame headers are incorrect... */
|
* 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) */
|
/* check channel count (only mono AHXs are known) */
|
||||||
if (read_8bit(7,streamFile) != 1) goto fail;
|
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. */
|
* so let's build the VGMSTREAM. */
|
||||||
|
|
||||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||||
@ -103,15 +102,10 @@ VGMSTREAM * init_vgmstream_ahx(STREAMFILE *streamFile) {
|
|||||||
|
|
||||||
/* clean up anything we may have opened */
|
/* clean up anything we may have opened */
|
||||||
fail:
|
fail:
|
||||||
if (data) {
|
free_mpeg(data);
|
||||||
if (data->m) {
|
if (vgmstream) vgmstream->codec_data = NULL;
|
||||||
mpg123_delete(data->m);
|
|
||||||
data->m = NULL;
|
close_vgmstream(vgmstream);
|
||||||
}
|
|
||||||
free(data);
|
|
||||||
data = NULL;
|
|
||||||
}
|
|
||||||
if (vgmstream) close_vgmstream(vgmstream);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ VGMSTREAM * init_vgmstream_ps3_xvag(STREAMFILE *streamFile) {
|
|||||||
#ifdef VGM_USE_MPEG
|
#ifdef VGM_USE_MPEG
|
||||||
else if(vgmstream->layout_type == layout_mpeg) {
|
else if(vgmstream->layout_type == layout_mpeg) {
|
||||||
for (i=0;i<channel_count;i++) {
|
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;
|
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 */
|
/* clean up anything we may have opened */
|
||||||
fail:
|
fail:
|
||||||
#ifdef VGM_USE_MPEG
|
#ifdef VGM_USE_MPEG
|
||||||
if (mpeg_data) {
|
free_mpeg(mpeg_data);
|
||||||
mpg123_delete(mpeg_data->m);
|
if (vgmstream) vgmstream->codec_data = NULL;
|
||||||
free(mpeg_data);
|
|
||||||
|
|
||||||
if (vgmstream) {
|
|
||||||
vgmstream->codec_data = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (vgmstream) close_vgmstream(vgmstream);
|
if (vgmstream) close_vgmstream(vgmstream);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user