ffmpeg: don't hold AV lock while fetching first packet/frame

This allows loading multiple videos side-by-side more effectively.

Closes #397
This commit is contained in:
rdb 2018-12-23 20:07:05 +01:00
parent e2574af82d
commit 8cb7f7d9c0
1 changed files with 2 additions and 2 deletions

View File

@ -79,8 +79,6 @@ init_from(FfmpegVideo *source) {
return;
}
ReMutexHolder av_holder(_av_lock);
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 45, 101)
_frame = av_frame_alloc();
_frame_out = av_frame_alloc();
@ -109,6 +107,8 @@ init_from(FfmpegVideo *source) {
_eof_known = false;
_eof_frame = 0;
ReMutexHolder av_holder(_av_lock);
// Check if we got an alpha format. Please note that some video codecs
// (eg. libvpx) change the pix_fmt after decoding the first frame, which is
// why we didn't do this earlier.