[svn r511] bug fix trunk
authorrenatofilho
Thu Apr 05 15:26:33 2007 +0100 (2007-04-05)
branchtrunk
changeset 5064fcd764b21a6
parent 505 b90373d8534b
child 507 178207a9cd61
[svn r511] bug fix
gst-plugins-mythtv/src/gstmythtvsrc.c
     1.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.c	Thu Apr 05 15:15:12 2007 +0100
     1.2 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c	Thu Apr 05 15:26:33 2007 +0100
     1.3 @@ -139,7 +139,7 @@
     1.4  
     1.5  static gboolean gst_mythtv_src_handle_event (GstPad * pad, GstEvent * event);
     1.6  
     1.7 -static gint do_read_request_response (GstMythtvSrc * src, guint size,
     1.8 +static GMythFileTransferReadResult do_read_request_response (GstMythtvSrc * src, guint size,
     1.9      GByteArray * data_ptr);
    1.10  
    1.11  static void
    1.12 @@ -330,8 +330,8 @@
    1.13    G_OBJECT_CLASS (parent_class)->finalize (gobject);
    1.14  }
    1.15  
    1.16 -static gint
    1.17 -do_read_request_response (GstMythtvSrc * src, guint size, GByteArray * data_ptr)
    1.18 +static GMythFileTransferReadResult
    1.19 +do_read_request_response (GstMythtvSrc * src, guint size, GByteArray *data_ptr)
    1.20  {
    1.21    gint read = 0;
    1.22    guint sizetoread = size;
    1.23 @@ -342,20 +342,17 @@
    1.24  
    1.25    /* Loop sending the Myth File Transfer request:
    1.26     * Retry whilst authentication fails and we supply it. */
    1.27 -  gint len = 0;
    1.28  
    1.29    while (sizetoread == size && --max_iters > 0) {
    1.30 -
    1.31      result = gmyth_file_transfer_read (src->file_transfer,
    1.32          data_ptr, sizetoread, src->live_tv);
    1.33  
    1.34 -    if (len > 0) {
    1.35 +    if (data_ptr->len > 0) {
    1.36        read += data_ptr->len;
    1.37        sizetoread -= data_ptr->len;
    1.38 -    } else if (len < 0) {
    1.39 -
    1.40 +    } else if (data_ptr->len < 0) {
    1.41        if (src->live_tv == FALSE) {
    1.42 -        read = -1;
    1.43 +        result = GMYTH_FILE_TRANSFER_READ_EOF;
    1.44          goto eos;
    1.45        } else {
    1.46          if (result == GMYTH_FILE_TRANSFER_READ_ERROR) {  /* -314 */
    1.47 @@ -376,8 +373,10 @@
    1.48        goto done;
    1.49    }
    1.50  
    1.51 -  if ((read < 0 && !src->live_tv) || max_iters == 0)
    1.52 +  if ((read < 0 && !src->live_tv) || max_iters == 0){
    1.53 +    result = GMYTH_FILE_TRANSFER_READ_EOF;
    1.54      goto eos;
    1.55 +  }
    1.56  
    1.57    goto done;
    1.58  
    1.59 @@ -385,7 +384,7 @@
    1.60    src->eos = TRUE;
    1.61  
    1.62  done:
    1.63 -  return read;
    1.64 +  return result;
    1.65  }
    1.66  
    1.67  static GstFlowReturn