summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-10-19 17:12:21 +0000
committerjstebbins <[email protected]>2010-10-19 17:12:21 +0000
commit1d9ac0132843794fc3800b09bb14e7e9c6643c7b (patch)
treebb6ab267a3ce0512a62332a9f7d0f18bcd0ce3f8
parent0dac83a2e9b8bd8fdddbd5b73b9719bc7c164bc2 (diff)
fix zero duration lpcm frame handling
a zero duration frame caused us to send a buffer with zero size which we then interpreted as the end of the stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3607 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/declpcm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libhb/declpcm.c b/libhb/declpcm.c
index 50a5a128d..f47fe87b9 100644
--- a/libhb/declpcm.c
+++ b/libhb/declpcm.c
@@ -178,8 +178,13 @@ static int declpcmWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
static hb_buffer_t *Decode( hb_work_object_t *w )
{
hb_work_private_t *pv = w->private_data;
- hb_buffer_t *out = hb_buffer_init( pv->count * sizeof( float ) );
+ hb_buffer_t *out;
+ if (pv->count == 0)
+ return NULL;
+
+ out = hb_buffer_init( pv->count * sizeof( float ) );
+
out->start = pv->next_pts;
pv->next_pts += pv->duration;
out->stop = pv->next_pts;