# HG changeset patch # User renatofilho # Date 1175721110 -3600 # Node ID b0e8a532e88240e743c494d5fe2d2dfa8d47f1b7 # Parent aa932d8bf85bd927d62a315421fc28c45bb44590 [svn r508] updated to new gmyth_file_transfer_read diff -r aa932d8bf85b -r b0e8a532e882 gst-plugins-mythtv/configure.ac --- a/gst-plugins-mythtv/configure.ac Wed Apr 04 21:53:33 2007 +0100 +++ b/gst-plugins-mythtv/configure.ac Wed Apr 04 22:11:50 2007 +0100 @@ -98,32 +98,14 @@ AC_SUBST(GOBJECT_CFLAGS) AC_SUBST(GOBJECT_LIBS) -dnl ========== Check for Hildon Libraries -PKG_CHECK_MODULES(HILDON, - hildon-lgpl libosso hildon-status-bar-lib libhildonmenu hildon-base-lib hildon-control-panel hildon-libs, - HAVE_HILDON=yes, HAVE_HILDON=no) - -if test "x$HAVE_HILDON" = "xyes"; then - AC_DEFINE(MAEMO_PLATFORM, 1, [build with hildon libs]) - HILDON_CFLAGS="$HILDON_CFLAGS -DMAEMO_PLATFORM=1" -else - AC_MSG_RESULT(no) -fi - -AM_CONDITIONAL(MAEMO_PLATFORM, test "x$HAVE_HILDON" = "xyes") - -dnl make HILDON_CFLAGS and HILDON_LIBS available -AC_SUBST(HILDON_CFLAGS) -AC_SUBST(HILDON_LIBS) - dnl *** MythTV *** PKG_CHECK_MODULES(GMYTH, - gmyth-0.1, + gmyth, HAVE_GMYTH=yes, HAVE_GMYTH=no) # Give error and exit if we don't have gobject if test "x$HAVE_GMYTH" = "xno"; then - AC_MSG_ERROR(you need gmyth-0.1 must to be installed) + AC_MSG_ERROR(you need gmyth must to be installed) fi # make GMYTH_CFLAGS and GMYTH_LIBS available diff -r aa932d8bf85b -r b0e8a532e882 gst-plugins-mythtv/src/gstmythtvsrc.c --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Wed Apr 04 21:53:33 2007 +0100 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Wed Apr 04 22:11:50 2007 +0100 @@ -336,6 +336,7 @@ gint read = 0; guint sizetoread = size; gint max_iters = GMYTHTV_TRANSFER_MAX_RESENDS; + GMythFileTransferReadResult result; GST_LOG_OBJECT (src, "Starting: Reading %d bytes...", sizetoread); @@ -345,22 +346,22 @@ while (sizetoread == size && --max_iters > 0) { - len = gmyth_file_transfer_read (src->file_transfer, + result = gmyth_file_transfer_read (src->file_transfer, data_ptr, sizetoread, src->live_tv); if (len > 0) { - read += len; - sizetoread -= len; + read += data_ptr->len; + sizetoread -= data_ptr->len; } else if (len < 0) { if (src->live_tv == FALSE) { read = -1; goto eos; } else { - if (len == GMYTHTV_FILE_TRANSFER_READ_ERROR) { /* -314 */ + if (result == GMYTH_FILE_TRANSFER_READ_ERROR) { /* -314 */ GST_INFO_OBJECT (src, "[LiveTV] FileTransfer READ_ERROR!"); goto done; - } else if (len == GMYTHTV_FILE_TRANSFER_NEXT_PROG_CHAIN) { /* -315 */ + } else if (result == GMYTH_FILE_TRANSFER_READ_NEXT_PROG_CHAIN) { /* -315 */ GST_INFO_OBJECT (src, "[LiveTV] FileTransfer - Go to the next program chain!"); continue; @@ -368,7 +369,7 @@ goto done; } - } else if (len == 0) + } else if (data_ptr->len == 0) goto done; if (read == sizetoread) @@ -392,7 +393,6 @@ { GstMythtvSrc *src; GstFlowReturn ret = GST_FLOW_OK; - gint read = -1; src = GST_MYTHTV_SRC (psrc); @@ -412,6 +412,7 @@ /* just get from the byte array, no network effort... */ if ((src->buffer_remain = src->bytes_queue->len) < MAX_READ_SIZE) { GByteArray *buffer; + GMythFileTransferReadResult result = GMYTH_FILE_TRANSFER_READ_OK; buffer = NULL; guint buffer_size_inter = (INTERNAL_BUFFER_SIZE - src->buffer_remain); @@ -421,16 +422,16 @@ buffer = g_byte_array_new (); - read = do_read_request_response (src, buffer_size_inter, buffer); + result = do_read_request_response (src, buffer_size_inter, buffer); - if (G_UNLIKELY (read < 0)) { + if (G_UNLIKELY (buffer->len < 0)) { if (buffer != NULL) { g_byte_array_free (buffer, TRUE); buffer = NULL; } - if (src->live_tv || ( read == GMYTHTV_FILE_TRANSFER_NEXT_PROG_CHAIN )) + if (src->live_tv || ( result == GMYTH_FILE_TRANSFER_READ_NEXT_PROG_CHAIN )) goto change_progchain; else goto read_error; @@ -457,13 +458,13 @@ } src->bytes_queue = - g_byte_array_append (src->bytes_queue, buffer->data, read); - if (read > buffer_size_inter) + g_byte_array_append (src->bytes_queue, buffer->data, buffer->len); + if (buffer->len > buffer_size_inter) GST_WARNING_OBJECT (src, "INCREASED buffer size! Backend sent more than we ask him... (%d)", abs (read - buffer_size_inter)); - src->buffer_remain += read; + src->buffer_remain += buffer->len; if (buffer != NULL) { g_byte_array_free (buffer, TRUE); @@ -726,7 +727,7 @@ "MythTV FileTransfer filesize = %lld, content_size = %lld!", src->file_transfer->filesize, src->content_size); - src->content_size = src->file_transfer->filesize; + src->content_size = gmyth_file_transfer_get_filesize (src->file_transfer); src->do_start = FALSE;