changeset 25010:9a4d15a28d12

fetch metadata for audio (from amol)
author lu_zero
date Tue, 13 Nov 2007 23:00:12 +0000
parents 8af79723e63e
children 39b7d358106a
files libmpdemux/demux_nemesi.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_nemesi.c	Tue Nov 13 22:57:22 2007 +0000
+++ b/libmpdemux/demux_nemesi.c	Tue Nov 13 23:00:12 2007 +0000
@@ -74,12 +74,13 @@
     rtp_ssrc *ssrc = NULL;
     rtp_frame * fr = &ndsd->first_pkt[stype];
     rtp_buff trash_buff;
+    int must_prefetch = ((fps != NULL) || (buff != NULL)) ? 1 : 0;
 
     ndsd->session[stype] = sess;
 
     ssrc = wait_for_packets(ndsd, stype);
 
-    if ( (ssrc) && (fps != NULL) ) {
+    if ( ((ssrc) && (must_prefetch)) ) {
         if (buff == NULL)
             buff = &trash_buff;
 
@@ -88,7 +89,7 @@
         /* 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) {
+        if ( ((!force_fps) && (fps != NULL)) ) {
             while ( *fps <= 0 ) {
                 //Wait more pkts to calculate FPS and try again
                 sched_yield();