Skip to content

Commit

Permalink
One could claim that having the ffmpeg file handle open while just st…
Browse files Browse the repository at this point in the history
…reaming is wasteful. I agree.
  • Loading branch information
skinkie committed Jan 18, 2013
1 parent 4294cea commit b16c79f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cherokee/handler_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ cherokee_handler_streaming_free (cherokee_handler_streaming_t *hdl)
cherokee_handler_free ((void *) hdl->handler_file);
}

if (hdl->avformat != NULL) {
TRACE(ENTRIES, "close_file (free) %s\n", hdl->local_file.buf);
av_close_input_file (hdl->avformat);
}

cherokee_buffer_mrproper (&hdl->local_file);
return ret_ok;
}
Expand Down Expand Up @@ -474,7 +469,7 @@ cherokee_handler_streaming_init (cherokee_handler_streaming_t *hdl)

ret = seek_mp3 (hdl);
if (unlikely (ret != ret_ok)) {
return ret_error;
goto out;
}
}

Expand All @@ -484,6 +479,14 @@ cherokee_handler_streaming_init (cherokee_handler_streaming_t *hdl)
set_auto_rate (hdl);
}

out:
/* Close our ffmpeg handle, all information has been gathered
*/
if (hdl->avformat != NULL) {
TRACE(ENTRIES, "close_file %s\n", hdl->local_file.buf);
av_close_input_file (hdl->avformat);
}

return ret_ok;
}

Expand Down

0 comments on commit b16c79f

Please sign in to comment.