[xiph-cvs] cvs commit: icecast/src format_vorbis.c

Ed oddsock at xiph.org
Thu Jun 26 06:31:38 PDT 2003



oddsock     03/06/26 09:31:38

  Modified:    src      format_vorbis.c
  Log:
  - force touches when vorbis metadata changes

Revision  Changes    Path
1.13      +22 -0     icecast/src/format_vorbis.c

Index: format_vorbis.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format_vorbis.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- format_vorbis.c	15 Mar 2003 02:10:17 -0000	1.12
+++ format_vorbis.c	26 Jun 2003 13:31:38 -0000	1.13
@@ -106,6 +106,10 @@
     char *tag;
     refbuf_t *refbuf;
     vstate_t *state = (vstate_t *)self->_state;
+#ifdef USE_YP
+    source_t *source;
+    time_t current_time;
+#endif
 
     if (data) {
         /* write the data to the buffer */
@@ -166,6 +170,24 @@
                 ogg_stream_clear(&state->os);
                 vorbis_comment_clear(&state->vc);
                 vorbis_info_clear(&state->vi);
+#ifdef USE_YP
+                /* If we get an update on the mountpoint, force a
+                   yp touch */
+                avl_tree_rlock(global.source_tree);
+                source = source_find_mount(self->mount);
+                avl_tree_unlock(global.source_tree);
+
+                if (source) {
+                    /* If we get an update on the mountpoint, force a
+                       yp touch */
+                    current_time = time(NULL);
+                    for (i=0; i<source->num_yp_directories; i++) {
+                        source->ypdata[i]->yp_last_touch = current_time -
+                            source->ypdata[i]->yp_touch_interval + 2;
+                    }
+                }
+#endif
+
             }
         }
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list