Example #1
0
int cmyth_livetv_chain_read(cmyth_recorder_t rec, char *buf, unsigned long len)
{
	int ret, retry;

	cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) {\n", 
        __FUNCTION__,	__FILE__, __LINE__);

	if (rec == NULL) {
		cmyth_dbg(CMYTH_DBG_ERROR, "%s: no connection\n",
			  __FUNCTION__);
		return -EINVAL;
	}

	do {
		retry = 0;
		ret = cmyth_file_read(rec->rec_livetv_file, buf, len);	
		if (ret == 0) {
			/* eof, switch to next file */
			PRINTF("**SSDEBUG:(cmyth_livetv_chain_read): %s\n",
			"reached end of stream must dooSwitcheroo");
			retry = cmyth_livetv_chain_switch(rec, 1);
		}
	} while(retry);

	cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) }\n",
				__FUNCTION__, __FILE__, __LINE__);

	return ret;
}
Example #2
0
int cmyth_livetv_chain_read(cmyth_recorder_t rec, char *buf, unsigned long len)
{
    int ret, retry;

//	cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) {\n",
//        __FUNCTION__,	__FILE__, __LINE__);

    if (rec == NULL) {
        cmyth_dbg(CMYTH_DBG_ERROR, "%s: no connection\n",
                  __FUNCTION__);
        return -EINVAL;
    }

    do {
        retry = 0;
        if ((rec->rec_livetv_file->file_req > 0)
                || (ret = cmyth_file_data_conn_fd(rec->rec_livetv_file)) == 1) {
            ret = cmyth_file_read(rec->rec_livetv_file, buf, len);
        }
        if (ret == 0) {
            /* eof, switch to next file */
            retry = cmyth_livetv_chain_switch_unlocked(rec, 1);
        }
    } while(retry);

//	cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) }\n",
//				__FUNCTION__, __FILE__, __LINE__);

    return ret;
}
Example #3
0
int MythFile::Read(void *buffer, unsigned int length)
{
  int bytesRead;
  bytesRead = cmyth_file_read(*m_file_t, static_cast< char * >(buffer), length);
  return bytesRead;
}