Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (kxMovieError) openInput: (NSString *) path
- {
- AVFormatContext *formatCtx = NULL;
- if (_interruptCallback) {
- formatCtx = avformat_alloc_context();
- if (!formatCtx)
- return kxMovieErrorOpenFile;
- AVIOInterruptCB cb = {interrupt_callback, (__bridge void *)(self)};
- formatCtx->interrupt_callback = cb;
- }
- if (avformat_open_input(&formatCtx, [path cStringUsingEncoding: NSUTF8StringEncoding], NULL, NULL) < 0) {
- if (formatCtx)
- avformat_free_context(formatCtx);
- return kxMovieErrorOpenFile;
- }
- if (avformat_find_stream_info(formatCtx, NULL) < 0) {
- avformat_close_input(&formatCtx);
- return kxMovieErrorStreamInfoNotFound;
- }
- av_dump_format(formatCtx, 0, [path.lastPathComponent cStringUsingEncoding: NSUTF8StringEncoding], false);
- _formatCtx = formatCtx;
- return kxMovieErrorNone;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement