i tried to apply the same changes, but i dunno why fileogg.C in flush_ogg() 
does not use ogg_stream_flush(), only ogg_stream_pageout(), and i introduced 
one ogg_stream_flush() and now the plugin got bad.
the pathes are attached, for anyone that want to play with it.
i don't unsderstand some things in the cinelerra code, so if i did something 
very wrong...

bye,
rafael diniz

Em Qui 16 Mar 2006 01:59, [EMAIL PROTECTED] escreveu:
> hi rafael,
>
> > > there was an issue wrt silence that resulted in to big chunks of
> > > audio/video being muxed into ogg at one time, in ffmpeg2theora too, i
> > > fixed it in the latest version, it might help to port the changes to
> > > cinelerra.
> >
> > Is it a fix of 0.15 to 0.16?
>
> yes, here is the related changeset http://trac.xiph.org/changeset/10563
>
> j
>
>
> _______________________________________________
> Cinelerra mailing list
> [email protected]
> https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra

-- 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Eng. da Computação @  Unicamp
Radio Muda, radiolivre.org, Centro de Mídia Independente, SubMídia
Chave PGP: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x2FF86098
-> orkut sucks, e naum estou nessa porcaria <-
"Acreditar que um conhecimento possa ser vendido ou
comprado é uma forma sutil e cruel de perpetuar a ignorância."
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Index: fileogg.C
===================================================================
--- fileogg.C	(revisão 749)
+++ fileogg.C	(cópia de trabalho)
@@ -188,6 +188,7 @@
 {
 	this->rd = rd;
 	this->wr = wr;
+
 	if (!tf)
 	{
 		tf = new theoraframes_info_t;
@@ -195,6 +196,11 @@
 		tf->videosync = 0;
 	}
 
+	if (tf){
+	        tf->v_pkg = 0;
+	        tf->a_pkg = 0;
+	}
+
 TRACE("FileOGG::open_file 10")
 	if(wr)
 	{
@@ -1693,6 +1699,7 @@
     fprintf(stderr,"error writing audio page\n"); 
   }
   tf->apage_valid = 0;
+  tf->a_pkg -= ogg_page_packets((ogg_page *)&tf->audiopage) ;
   return ret;
 }
 
@@ -1705,6 +1712,7 @@
     fprintf(stderr,"error writing video page\n");
   }
   tf->vpage_valid = 0;
+  tf->v_pkg -= ogg_page_packets((ogg_page *)&tf->videopage);
   return ret;
 }
 
@@ -1712,13 +1720,20 @@
 {
     int len;
     ogg_page og;
-
-	flush_lock->lock();
+    
+    flush_lock->lock();
     /* flush out the ogg pages  */
     while(1) {
       /* Get pages for both streams, if not already present, and if available.*/
       if(asset->video_data && !tf->vpage_valid) {
-        if(ogg_stream_pageout(&tf->to, &og) > 0) {
+	int v_next = 0;
+	if (tf->v_pkg > 22 && ogg_stream_flush(&tf->to, &og)){
+	  v_next = 1;
+        }      
+	else if(ogg_stream_pageout(&tf->to, &og) > 0 ){
+	  v_next = 1;
+      }
+      if (v_next) {
           len = og.header_len + og.body_len;
           if(tf->vpage_buffer_length < len) {
             tf->vpage = (unsigned char *)realloc(tf->vpage, len);
@@ -1734,7 +1749,14 @@
         }
       }
       if(asset->audio_data && !tf->apage_valid) {
-        if(ogg_stream_pageout(&tf->vo, &og) > 0) {
+	int a_next = 0;
+	if(tf->a_pkg > 22 && ogg_stream_flush(&tf->vo, &og) > 0 ) {
+	  a_next = 1;
+        }
+        else if(ogg_stream_pageout(&tf->vo, &og) > 0) {
+          a_next=1;
+        }
+        if(a_next) {
           len = og.header_len + og.body_len;
           if(tf->apage_buffer_length < len) {
             tf->apage = (unsigned char *)realloc(tf->apage, len);
@@ -1815,6 +1837,7 @@
 		flush_lock->lock();
 		ogg_stream_packetin (&tf->vo, &tf->op);
 		flush_lock->unlock();
+		tf->a_pkg++;
 	    }
 
 	}
@@ -1873,6 +1896,7 @@
 				flush_lock->lock();
 				ogg_stream_packetin (&tf->to, &tf->op);
 				flush_lock->unlock();
+				tf->v_pkg++;
             }
 			flush_ogg(0);  // eos flush is done later at close_file
 		}
Index: fileogg.h
===================================================================
--- fileogg.h	(revisão 749)
+++ fileogg.h	(cópia de trabalho)
@@ -63,10 +63,14 @@
 
 
 // stuff needed for reading only
-	sync_window_t *audiosync;
-	sync_window_t *videosync;
+    sync_window_t *audiosync;
+    sync_window_t *videosync;
 	
 
+ //to do some manual page flusing 
+    int v_pkg; 
+    int a_pkg; 
+
 }
 theoraframes_info_t;
 

Attachment: pgphNSvavwdvi.pgp
Description: PGP signature

Reply via email to