changeset 24998:c6aaf2165751

fix forcefps (from amol)
author lu_zero
date Mon, 12 Nov 2007 16:31:52 +0000
parents e429129fa02b
children 903477cad47d
files libmpdemux/demux_nemesi.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_nemesi.c	Mon Nov 12 16:26:33 2007 +0000
+++ b/libmpdemux/demux_nemesi.c	Mon Nov 12 16:31:52 2007 +0000
@@ -84,11 +84,17 @@
             buff = &trash_buff;
 
         rtp_fill_buffer(ssrc, fr, buff); //Prefetch the first packet
-        while ( !(rtp_get_pkt(ssrc, NULL)) ) //Wait second pkt to calculate FPS
-            sched_yield();
 
-        if ( (force_fps == 0.0) && (fps != NULL) )
-            *fps = rtp_get_fps(ssrc);
+        /* Packet prefecthing must be done anyway or we won't be
+           able to get the metadata, but fps calculation happens
+           only if the user didn't specify the FPS */
+        if (!force_fps) {
+            while ( *fps <= 0 ) {
+                //Wait more pkts to calculate FPS and try again
+                sched_yield();
+                *fps = rtp_get_fps(ssrc);
+            }
+        }
     }
 }