# HG changeset patch
# User rosfran
# Date 1179527340 -3600
# Node ID 4712c96954be705a611d2ded8fa9e83ea3e07c45
# Parent  b27d653ff6f1c3a7b5ddbdcd66f56790f34a6942
[svn r701] Solves some bugs with the program info.

diff -r b27d653ff6f1 -r 4712c96954be gst-gmyth/mythsrc/gstmythtvsrc.c
--- a/gst-gmyth/mythsrc/gstmythtvsrc.c	Fri May 18 22:45:49 2007 +0100
+++ b/gst-gmyth/mythsrc/gstmythtvsrc.c	Fri May 18 23:29:00 2007 +0100
@@ -474,23 +474,30 @@
     result = do_read_request_response (src, buffer_size_inter, buffer);
 
     /* got the next program info? */
-    if (G_UNLIKELY (src->update_prog_chain)) {
+    if (G_UNLIKELY (src->update_prog_chain) || (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN)) {
+      GST_DEBUG_OBJECT (src, "Update PROGRAM CHAIN!!! buffer_size = %d.",
+	    src->bytes_queue->len);
+      gst_pad_push_event (GST_BASE_SRC_PAD (GST_BASE_SRC (psrc)),
+		      gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, 0, -1, 0));
+
       if (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN) {
+      	 /*
          if  (buffer != NULL) {
            g_byte_array_free (buffer, TRUE);
            buffer = NULL;
          }
-         goto program_chain_changed; 
+         goto program_chain_changed; */
       } else if (result == GMYTH_FILE_READ_OK) {
         /* remove wasteful, NUV file header data */
-        buffer = g_byte_array_remove_range( buffer, 0, 512 );
+        /* buffer = g_byte_array_remove_range( buffer, 0, 512 ); */
 	/* TODO: need to send a new segment event to NUVDemux? */
 	gst_pad_push_event (GST_BASE_SRC_PAD (GST_BASE_SRC (psrc)),
 			gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, 0, -1, 0));
 
         /* goto change_progchain; */
       }
-    }
+
+    } /* */
 
     if (G_UNLIKELY (buffer->len < 0)) {