[vlc-devel] 答复: demux: adaptive: fix a zero-divid bug.

Xie Zhigang zighouse at hotmail.com
Sat Nov 24 04:55:13 CET 2018


Hi Zhao,
I found it at vlc-3.0.0 on Windows-7. This bug is not easy to repeat but I encountered it twice at night automatic testing loop of play-stop-sequence for an unstable hls stream via wifi. The hls stream is created by a shell script which building a gstreamer pipeline. If the pipeline is down, restart the script automatically.

The pipeline scipt is something like:

gst-launch-1.0 mpegtsmux name=m ! \
  hlssink target-duration=2 max-files=15 playlist-length=5 location=media/s%05d.ts \
  playlist-location=media/playlist.m3u8 \
udpsrc port=$aport ! \
  application/x-rtp, media=audio, playload=0, clock-rate=8000, rate=8000 ! \
  rptpcmudepay ! mulawdec ! \
  audioconvert ! audioresample ! audio/x-raw, rate=44100 ! \
  queue ! voaacenc bitrate=96000 hard-resync=true ! queue ! \
  m. \
udpsrc port=$vport ! \
  application/x-rtp, payload=106, clock-rate=90000 ! \
  rtpjitterbuffer latency=100 ! \
  rtph264depay ! h264parse ! avdec_h264 ! \
  videoconvert ! videorate ! video/x-raw, framerate=15/1 ! queue ! \
 x264enc bframes=0 ! queue ! \
 h264parse config-interval=1 ! m.

And, I use tcpreplay to replay a pcap in a loop-way to inject audio- and video- element streams into udp ports constantly.
________________________________
发件人: vlc-devel <vlc-devel-bounces at videolan.org> 代表 Zhao Zhili <quinkblack at foxmail.com>
发送时间: 2018年11月22日 11:00
收件人: vlc-devel at videolan.org
主题: Re: [vlc-devel] demux: adaptive: fix a zero-divid bug.

Hi Xie,
What's the version of VLC has this bug?
If NearOptimalAdaptationLogic has this problem, then other
AdaptationLogics have this problem too, so this patch is not complete.
On the other hand, modules/demux/adaptive/http/Chunk.cpp doesn't call
updateDownloadRate if time is zero. I don't know how this can happen.

On 2018/11/15 下午6:49, Xie Zhigang wrote:
> fixes crashs on some cases with zero update download rates.
> ---
>   modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
> index 1c99538..32bb863 100644
> --- a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
> +++ b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
> @@ -179,6 +179,9 @@ unsigned NearOptimalAdaptationLogic::getMaxCurrentBw() const
>
>   void NearOptimalAdaptationLogic::updateDownloadRate(const ID &id, size_t dlsize, vlc_tick_t time)
>   {
> +    if (time <= 0)
> +        return;
> +
>       vlc_mutex_lock(&lock);
>       std::map<ID, NearOptimalContext>::iterator it = streams.find(id);
>       if(it != streams.end())



_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20181124/b398082e/attachment.html>


More information about the vlc-devel mailing list