=== modified file 'ext/flac/gstflacdec.c'
--- ext/flac/gstflacdec.c	
+++ ext/flac/gstflacdec.c	
@@ -482,8 +482,6 @@
     flacdec->need_newsegment = FALSE;
   }
 
-  g_assert (width % 8 == 0);    /* width must be a multiple of 8 */
-
   ret = gst_pad_alloc_buffer_and_set_caps (flacdec->srcpad,
       flacdec->segment.last_stop, samples * channels * (width / 8),
       GST_PAD_CAPS (flacdec->srcpad), &outbuf);
@@ -658,18 +656,18 @@
   guint bytes_per_sample;
   guint scale = 1;
 
-  g_assert (flacdec->width > 0);
-  g_assert (flacdec->width % 8 == 0);
-  g_assert (flacdec->channels > 0);
-
+  if (flacdec->width == 0 || flacdec->channels == 0
+      || flacdec->sample_rate == 0) {
+    /* no frame decoded yet */
+    return FALSE;
+  }
+  
   bytes_per_sample = flacdec->channels * (flacdec->width / 8);
 
   switch (src_format) {
     case GST_FORMAT_BYTES:{
       switch (*dest_format) {
         case GST_FORMAT_DEFAULT:
-          if (bytes_per_sample == 0)
-            return FALSE;
           *dest_value =
               gst_util_uint64_scale_int (src_value, 1, bytes_per_sample);
           break;
@@ -677,9 +675,6 @@
         {
           gint byterate = bytes_per_sample * flacdec->sample_rate;
 
-          if (byterate == 0)
-            return FALSE;
-
           *dest_value = gst_util_uint64_scale_int (src_value, GST_SECOND,
               byterate);
           break;
@@ -695,8 +690,6 @@
           *dest_value = src_value * bytes_per_sample;
           break;
         case GST_FORMAT_TIME:
-          if (flacdec->sample_rate == 0)
-            return FALSE;
           *dest_value = gst_util_uint64_scale_int (src_value, GST_SECOND,
               flacdec->sample_rate);
           break;
@@ -1062,6 +1055,10 @@
       flacdec->segment.last_stop = 0;
       flacdec->need_newsegment = TRUE;
       flacdec->seeking = FALSE;
+      flacdec->channels = 0;
+      flacdec->depth = 0;
+      flacdec->width = 0;
+      flacdec->sample_rate = 0;
       if (flacdec->init == FALSE) {
         FLAC__seekable_stream_decoder_reset (flacdec->decoder);
       }

