summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-05-18 08:55:32 -0600
committerJohn Stebbins <[email protected]>2016-05-18 08:55:32 -0600
commit09d96a870bdd47d4fd598710e6fc78556b5931a5 (patch)
tree523c70ee611135a55c7ff61844df2e02919b209e
parent6c84891b644b911ace7d02210ad21a94922c8287 (diff)
sync: move comment to more appropriate location
-rw-r--r--libhb/sync.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index b5eb8debe..5ffbc3cac 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -20,6 +20,18 @@
#define SYNC_MAX_AUDIO_QUEUE_LEN 60
#define SYNC_MIN_AUDIO_QUEUE_LEN 30
+// We do not place a limit on the number of subtitle frames
+// that are buffered (max_len == INT_MAX) becuase there are
+// cases where we will receive all the subtitles for a file
+// all at once (SSA subs).
+//
+// If we did not buffer these subs here, the following deadlock
+// condition would occur:
+// 1. Subtitle decoder blocks trying to generate more subtitle
+// lines than will fit in sync input buffers.
+// 2. This blocks the reader. Reader doesn't read any more
+// audio or video, so sync won't receive buffers it needs
+// to unblock subtitles.
#define SYNC_MAX_SUBTITLE_QUEUE_LEN INT_MAX
#define SYNC_MIN_SUBTITLE_QUEUE_LEN 0
@@ -1295,16 +1307,6 @@ static void QueueBuffer( sync_stream_t * stream, hb_buffer_t * buf )
{
hb_lock(stream->common->mutex);
- // We do not place a limit on the number of subtitle frames
- // that are buffered becuase there are cases where we will
- // receive all the subtitles for a file all at once (SSA subs).
- // If we did not buffer these subs here, the following deadlock
- // condition would occur:
- // 1. Subtitle decoder blocks trying to generate more subtitle
- // lines than will fit in sync input buffers.
- // 2. This blocks the reader. Reader doesn't read any more
- // audio or video, so sync won't receive buffers it needs
- // to unblock subtitles.
while (hb_list_count(stream->in_queue) > stream->max_len)
{
hb_cond_wait(stream->cond_full, stream->common->mutex);