summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_nemesi.c14
1 files 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);
+ }
+ }
}
}