aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/acinerella
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/lib/acinerella')
-rw-r--r--Game/Code/lib/acinerella/acinerella.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/Game/Code/lib/acinerella/acinerella.c b/Game/Code/lib/acinerella/acinerella.c
index 509346a7..5b0178e4 100644
--- a/Game/Code/lib/acinerella/acinerella.c
+++ b/Game/Code/lib/acinerella/acinerella.c
@@ -344,7 +344,10 @@ int CALL_CONVT ac_open(
AC_BUFSIZE, 0, pacInstance, io_read, 0, io_seek);
}
- if(av_open_input_stream(&(((lp_ac_data)pacInstance)->pFormatCtx),
+ //Open the given input stream (the io structure) with the given format of the stream
+ //(fmt) and write the pointer to the new format context to the pFormatCtx variable
+ if (av_open_input_stream(
+ &(((lp_ac_data)pacInstance)->pFormatCtx),
&(((lp_ac_data)pacInstance)->io), "", fmt, NULL) < 0)
{
return -1;
@@ -386,11 +389,12 @@ void CALL_CONVT ac_close(lp_ac_instance pacInstance) {
av_close_input_stream(((lp_ac_data)(pacInstance))->pFormatCtx);
pacInstance->opened = 0;
- /*
- Auto freed by av_close_input_stream
- if (((lp_ac_data)(pacInstance))->buffer) {
+ //If the seek proc has not been specified, the input buffer is not automatically
+ //freed, as ffmpeg didn't get the original pointer to the buffer
+ if (!((lp_ac_data)(pacInstance))->seek_proc &&
+ ((lp_ac_data)(pacInstance))->buffer) {
av_free(((lp_ac_data)(pacInstance))->buffer);
- }*/
+ }
}
}