Made CheckSeek() threadsafe

This commit is contained in:
Jonathan Thomas
2012-07-03 02:59:38 -05:00
parent a662abcfd7
commit 6553f49874
2 changed files with 12 additions and 5 deletions

View File

@@ -273,6 +273,7 @@ Frame FFmpegReader::ReadStream(int requested_frame)
{
// Allocate video frame
bool end_of_stream = false;
bool check_seek = false;
#pragma omp parallel
{
@@ -293,7 +294,10 @@ Frame FFmpegReader::ReadStream(int requested_frame)
if (packet->stream_index == videoStream)
{
// Check the status of a seek (if any)
if (CheckSeek(true))
#pragma omp critical (openshot_cache)
check_seek = CheckSeek(true);
if (check_seek)
// Jump to the next iteration of this loop
continue;
@@ -316,7 +320,10 @@ Frame FFmpegReader::ReadStream(int requested_frame)
cout << "AUDIO PACKET (PTS: " << packet->pts << ")" << endl;
// Check the status of a seek (if any)
if (CheckSeek(false))
#pragma omp critical (openshot_cache)
check_seek = CheckSeek(false);
if (check_seek)
// Jump to the next iteration of this loop
continue;