mirror of https://github.com/mpv-player/mpv
parent
5012e5156d
commit
2b337d67a4
|
@ -286,6 +286,8 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check)
|
||||||
.buf_size = 0,
|
.buf_size = 0,
|
||||||
.buf = av_mallocz(PROBE_BUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE),
|
.buf = av_mallocz(PROBE_BUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE),
|
||||||
};
|
};
|
||||||
|
if (!avpd.buf)
|
||||||
|
return -1;
|
||||||
|
|
||||||
bool final_probe = false;
|
bool final_probe = false;
|
||||||
do {
|
do {
|
||||||
|
@ -679,6 +681,8 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
avfc = avformat_alloc_context();
|
avfc = avformat_alloc_context();
|
||||||
|
if (!avfc)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (lavfdopts->cryptokey)
|
if (lavfdopts->cryptokey)
|
||||||
parse_cryptokey(avfc, lavfdopts->cryptokey);
|
parse_cryptokey(avfc, lavfdopts->cryptokey);
|
||||||
|
|
|
@ -353,6 +353,8 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
|
||||||
ctx->hwdec_fmt = 0;
|
ctx->hwdec_fmt = 0;
|
||||||
ctx->avctx = avcodec_alloc_context3(lavc_codec);
|
ctx->avctx = avcodec_alloc_context3(lavc_codec);
|
||||||
AVCodecContext *avctx = ctx->avctx;
|
AVCodecContext *avctx = ctx->avctx;
|
||||||
|
if (!ctx->avctx)
|
||||||
|
return;
|
||||||
avctx->bit_rate = 0;
|
avctx->bit_rate = 0;
|
||||||
avctx->opaque = vd;
|
avctx->opaque = vd;
|
||||||
avctx->codec_type = AVMEDIA_TYPE_VIDEO;
|
avctx->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
|
@ -360,6 +362,8 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
|
||||||
|
|
||||||
avctx->refcounted_frames = 1;
|
avctx->refcounted_frames = 1;
|
||||||
ctx->pic = av_frame_alloc();
|
ctx->pic = av_frame_alloc();
|
||||||
|
if (!ctx->pic)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ctx->hwdec) {
|
if (ctx->hwdec) {
|
||||||
avctx->thread_count = 1;
|
avctx->thread_count = 1;
|
||||||
|
|
Loading…
Reference in New Issue