# HG changeset patch # User renatofilho # Date 1175783193 -3600 # Node ID 4fcd764b21a6d4b6255e3dbe4cde331e37b666cd # Parent b90373d8534b6f2cb3cd42b4a463007d3c1095d5 [svn r511] bug fix diff -r b90373d8534b -r 4fcd764b21a6 gst-plugins-mythtv/src/gstmythtvsrc.c --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Thu Apr 05 15:15:12 2007 +0100 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Thu Apr 05 15:26:33 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