Просмотр исходного кода

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

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

Closes #397
rdb 7 лет назад
Родитель
Сommit
8cb7f7d9c0
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      panda/src/ffmpeg/ffmpegVideoCursor.cxx

+ 2 - 2
panda/src/ffmpeg/ffmpegVideoCursor.cxx

@@ -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.