summaryrefslogtreecommitdiffstats
path: root/libhb/sync.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-08-15 15:43:33 +0000
committerRodeo <[email protected]>2012-08-15 15:43:33 +0000
commit7cd3b216443482163c68e01fe48755f5763a7053 (patch)
treec929233dfecf243784a3e03f0402340755e99bed /libhb/sync.c
parent6254327d7932b0a33a533453ac11f66e0915a123 (diff)
Don't send empty audio packets downstream, as empty buffers are assumed to mark the end of stream.
Such packets can result from samplerate or other types of audio conversion. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4906 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r--libhb/sync.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index 73a1071e3..9c202c250 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -1085,6 +1085,13 @@ static hb_buffer_t * OutputAudioFrame( hb_audio_t *audio, hb_buffer_t *buf,
}
hb_buffer_close( &buf_raw );
+ if (sync->data.output_frames_gen <= 0)
+ {
+ // XXX: don't send empty buffers downstream (EOF)
+ // possibly out-of-sync audio is better than no audio at all
+ hb_buffer_close(&buf);
+ return NULL;
+ }
buf->size = sync->data.output_frames_gen * sample_size;
duration = (double)( sync->data.output_frames_gen * 90000 ) /
audio->config.out.samplerate;