/// <summary>
        /// Return true if the database contains no data for the given payload/cname/name/timerange.
        /// if name is null or empty, exclude it from the where clause.
        /// </summary>
        public static bool isEmptyStream(PayloadType payload, String cname, String name, long start, long end)
        {
            String query = "select count(*) " +
                           "from participant p join stream s on p.participant_id=s.participant_id " +
                           "join frame f on s.stream_id=f.stream_id where s.payload_type='" +
                           payload.ToString() + "' and p.cname='" + cname + "' ";

            if ((name != null) && (name.Trim() != ""))
            {
                query += "and s.name='" + name + "' ";
            }

            query += "and f.frame_time >= " + start.ToString() + " and f.frame_time < " +
                     end.ToString();

            int count = DatabaseUtility.numericQuery(query);

            if (count == 0)
            {
                return(true);
            }
            return(false);
        }