[vlc-commits] commit: stream_filter/httplive.c: quiet down playback stalling warning. ( Jean-Paul Saman )
git at videolan.org
git at videolan.org
Tue Jan 4 16:46:56 CET 2011
vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue Jan 4 11:47:23 2011 +0100| [0c90daf6386dc96836431245476c7e645bef6a5c] | committer: Jean-Paul Saman
stream_filter/httplive.c: quiet down playback stalling warning.
The playback stalling warning was printed too often. Only print this message when
playback is in real danger and check only on segment boundaries.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0c90daf6386dc96836431245476c7e645bef6a5c
---
modules/stream_filter/httplive.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index e3cc443..a50817c 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1719,10 +1719,19 @@ static segment_t *GetSegment(stream_t *s)
check:
/* sanity check */
- if (p_sys->download.segment - p_sys->playback.segment == 0)
- msg_Err(s, "playback will stall");
- else if (p_sys->download.segment - p_sys->playback.segment < 3)
- msg_Warn(s, "playback in danger of stalling");
+ if (segment->data->i_buffer == 0)
+ {
+ vlc_mutex_lock(&hls->lock);
+ int count = vlc_array_count(hls->segments);
+ vlc_mutex_unlock(&hls->lock);
+
+ if ((p_sys->download.segment - p_sys->playback.segment == 0) &&
+ ((count != p_sys->download.segment) || p_sys->b_live))
+ msg_Err(s, "playback will stall");
+ else if ((p_sys->download.segment - p_sys->playback.segment < 3) &&
+ ((count != p_sys->download.segment) || p_sys->b_live))
+ msg_Warn(s, "playback in danger of stalling");
+ }
return segment;
}
More information about the vlc-commits
mailing list