OSDN Git Service

fix zero duration lpcm frame handling
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 19 Oct 2010 17:12:21 +0000 (17:12 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 19 Oct 2010 17:12:21 +0000 (17:12 +0000)
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://localhost/HandBrake/trunk@3607 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/declpcm.c

index 50a5a12..f47fe87 100644 (file)
@@ -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;