From 365836f628f3f9688a96dcb1eab764da27de074a Mon Sep 17 00:00:00 2001 From: lu_zero Date: Mon, 12 Nov 2007 16:31:52 +0000 Subject: [PATCH] fix forcefps (from amol) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25026 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_nemesi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libmpdemux/demux_nemesi.c b/libmpdemux/demux_nemesi.c index c4c9fc4ed5..e440ea5a91 100644 --- a/libmpdemux/demux_nemesi.c +++ b/libmpdemux/demux_nemesi.c @@ -84,11 +84,17 @@ static void link_session_and_fetch_conf(Nemesi_DemuxerStreamData * ndsd, 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); + } + } } }