summaryrefslogtreecommitdiffstats
path: root/libhb/sync.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-05-01 14:47:35 +0000
committerjstebbins <[email protected]>2015-05-01 14:47:35 +0000
commit58b25a7664d9d063b404ec39270ff4cdfa333979 (patch)
tree3807be923b500ddc3f618170b7bd7c4900204bdd /libhb/sync.c
parent3e30a6ef3a449ac4cadb60fa738cc58f974c1794 (diff)
libhb: Use a buffer flat to indicate EOF
... instead of a 0 length buffer. This fixes this issue: https://forum.handbrake.fr/viewtopic.php?f=12&t=31959 Theora can create 0 length output. These 0 length frames indicate duplicate frames. So we can't use 0 length buffers to indicate the end of the stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7143 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r--libhb/sync.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index d11fbd228..594251b0d 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -600,7 +600,7 @@ static void flushSubtitles(hb_work_private_t *pv)
}
if (subtitle->config.dest == PASSTHRUSUB)
{
- hb_fifo_push(subtitle->fifo_out, hb_buffer_init(0));
+ hb_fifo_push(subtitle->fifo_out, hb_buffer_eof_init());
}
}
}
@@ -624,7 +624,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
next = *buf_in;
*buf_in = NULL;
- if (next->size == 0)
+ if (next->s.flags & HB_BUF_FLAG_EOF)
{
if (sync->cur != NULL)
{
@@ -738,7 +738,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
pv->common->count_frames);
hb_buffer_close(&sync->cur);
hb_buffer_close(&next);
- *buf_out = hb_buffer_init(0);
+ *buf_out = hb_buffer_eof_init();
flushSubtitles(pv);
// Unblock anybody waiting on this threads last PTS
setSyncPTS(pv, INT64_MAX, 0);
@@ -754,7 +754,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
sync->cur->s.start);
hb_buffer_close(&sync->cur);
hb_buffer_close( &next );
- *buf_out = hb_buffer_init(0);
+ *buf_out = hb_buffer_eof_init();
flushSubtitles(pv);
// Unblock anybody waiting on this threads last PTS
setSyncPTS(pv, INT64_MAX, 0);
@@ -874,7 +874,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
// muxer or renderer filter.
while ( ( sub = hb_fifo_get( subtitle->fifo_raw ) ) != NULL )
{
- if (sub->size > 0)
+ if (!(next->s.flags & HB_BUF_FLAG_EOF))
{
out = sanitizeSubtitle(pv, i, sub);
if (out != NULL)
@@ -1013,7 +1013,7 @@ static int syncAudioWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
*buf_in = NULL;
/* if the next buffer is an eof send it downstream */
- if ( buf->size <= 0 )
+ if (buf->s.flags & HB_BUF_FLAG_EOF)
{
*buf_out = buf;
// Unblock anybody waiting on this threads last PTS
@@ -1064,7 +1064,7 @@ static int syncAudioWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
if (job->frame_to_stop && pv->common->count_frames >= job->frame_to_stop)
{
hb_buffer_close( &buf );
- *buf_out = hb_buffer_init(0);
+ *buf_out = hb_buffer_eof_init();
// Unblock anybody waiting on this threads last PTS
setSyncPTS(pv, INT64_MAX, sync->index+1);
return HB_WORK_DONE;
@@ -1072,7 +1072,7 @@ static int syncAudioWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
if (job->pts_to_stop && sync->next_start >= job->pts_to_stop)
{
hb_buffer_close( &buf );
- *buf_out = hb_buffer_init(0);
+ *buf_out = hb_buffer_eof_init();
// Unblock anybody waiting on this threads last PTS
setSyncPTS(pv, INT64_MAX, sync->index+1);
return HB_WORK_DONE;