summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2018-07-25 20:43:00 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2018-07-25 20:43:00 +0300
commit5954670e3ecace2d6ce893509d91bdda0ad0ba06 (patch)
tree81932e8980958290627c0aebe3fe8e02f2c48e4b
parent82cfe8f74c5120afc7340fc99ca30f42f3c7da1b (diff)
Clean up decoder creation
-rw-r--r--src/internal/kitdecoder.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/internal/kitdecoder.c b/src/internal/kitdecoder.c
index 112be8e..0855eee 100644
--- a/src/internal/kitdecoder.c
+++ b/src/internal/kitdecoder.c
@@ -73,7 +73,7 @@ Kit_Decoder* Kit_CreateDecoder(const Kit_Source *src, int stream_index,
dec->codec_ctx = codec_ctx;
dec->format_ctx = format_ctx;
- // Allocate input/output ringbuffers and locks
+ // Allocate input/output ringbuffers
for(int i = 0; i < 2; i++) {
dec->buffer[i] = Kit_CreateBuffer(bsizes[i], free_hooks[i]);
if(dec->buffer[i] == NULL) {
@@ -86,14 +86,12 @@ Kit_Decoder* Kit_CreateDecoder(const Kit_Source *src, int stream_index,
dec->output_lock = SDL_CreateMutex();
if(dec->output_lock == NULL) {
Kit_SetError("Unable to allocate mutex for stream %d: %s", stream_index, SDL_GetError());
- goto exit_4;
+ goto exit_3;
}
// That's that
return dec;
-exit_4:
- SDL_DestroyMutex(dec->output_lock);
exit_3:
for(int i = 0; i < KIT_DEC_BUF_COUNT; i++) {
Kit_DestroyBuffer(dec->buffer[i]);