diff -r b0e8a532e882 -r 348964b09e4a gst-plugins-mythtv/src/gstmythtvsrc.c --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Wed Apr 04 22:11:50 2007 +0100 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Tue Apr 10 23:24:29 2007 +0100 @@ -139,7 +139,7 @@ static gboolean gst_mythtv_src_handle_event (GstPad * pad, GstEvent * event); -static gint do_read_request_response (GstMythtvSrc * src, guint size, +static GMythFileTransferReadResult do_read_request_response (GstMythtvSrc * src, guint size, GByteArray * data_ptr); static void @@ -330,8 +330,8 @@ G_OBJECT_CLASS (parent_class)->finalize (gobject); } -static gint -do_read_request_response (GstMythtvSrc * src, guint size, GByteArray * data_ptr) +static GMythFileTransferReadResult +do_read_request_response (GstMythtvSrc * src, guint size, GByteArray *data_ptr) { gint read = 0; guint sizetoread = size; @@ -342,20 +342,17 @@ /* Loop sending the Myth File Transfer request: * Retry whilst authentication fails and we supply it. */ - gint len = 0; while (sizetoread == size && --max_iters > 0) { - result = gmyth_file_transfer_read (src->file_transfer, data_ptr, sizetoread, src->live_tv); - if (len > 0) { + if (data_ptr->len > 0) { read += data_ptr->len; sizetoread -= data_ptr->len; - } else if (len < 0) { - + } else if (data_ptr->len < 0) { if (src->live_tv == FALSE) { - read = -1; + result = GMYTH_FILE_TRANSFER_READ_EOF; goto eos; } else { if (result == GMYTH_FILE_TRANSFER_READ_ERROR) { /* -314 */ @@ -376,8 +373,10 @@ goto done; } - if ((read < 0 && !src->live_tv) || max_iters == 0) + if ((read < 0 && !src->live_tv) || max_iters == 0){ + result = GMYTH_FILE_TRANSFER_READ_EOF; goto eos; + } goto done; @@ -385,7 +384,7 @@ src->eos = TRUE; done: - return read; + return result; } static GstFlowReturn