mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
paranoid locking
This commit is contained in:
parent
8801ec38d7
commit
5b7c19ee73
@ -952,6 +952,10 @@ seek(int frame, bool backward) {
|
||||
static PStatCollector seek_pcollector("*:FFMPEG Video Decoding:Seek");
|
||||
PStatTimer timer(seek_pcollector);
|
||||
|
||||
// Protect the call to av_seek_frame() in a global lock, just to be
|
||||
// paranoid.
|
||||
ReMutexHolder av_holder(_av_lock);
|
||||
|
||||
PN_int64 target_ts = (PN_int64)frame;
|
||||
if (target_ts < (PN_int64)(_initial_dts)) {
|
||||
// Attempts to seek before the first packet will fail.
|
||||
@ -992,8 +996,6 @@ seek(int frame, bool backward) {
|
||||
// it, and don't do this.
|
||||
|
||||
/*
|
||||
ReMutexHolder av_holder(_av_lock);
|
||||
|
||||
avcodec_close(_video_ctx);
|
||||
AVCodec *pVideoCodec = avcodec_find_decoder(_video_ctx->codec_id);
|
||||
if (pVideoCodec == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user