<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Zhao,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The pipeline scipt is something like:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
gst-launch-1.0 mpegtsmux name=m ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  hlssink target-duration=2 max-files=15 playlist-length=5 location=media/s%05d.ts \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  playlist-location=media/playlist.m3u8 \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
udpsrc port=$aport ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  application/x-rtp, media=audio, playload=0, clock-rate=8000, rate=8000 ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  rptpcmudepay ! mulawdec ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  audioconvert ! audioresample ! audio/x-raw, rate=44100 ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  queue ! voaacenc bitrate=96000 hard-resync=true ! queue ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  m. \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
udpsrc port=$vport ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  application/x-rtp, payload=106, clock-rate=90000 ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  rtpjitterbuffer latency=100 ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  rtph264depay ! h264parse ! avdec_h264 ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  videoconvert ! videorate ! video/x-raw, framerate=15/1 ! queue ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
 x264enc bframes=0 ! queue ! \</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
 h264parse config-interval=1 ! m.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And, I use tcpreplay to replay a pcap in a loop-way to inject audio- and video- element streams into udp ports constantly.</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>发件人:</b> vlc-devel <vlc-devel-bounces@videolan.org> 代表 Zhao Zhili <quinkblack@foxmail.com><br>
<b>发送时间:</b> 2018年11月22日 11:00<br>
<b>收件人:</b> vlc-devel@videolan.org<br>
<b>主题:</b> Re: [vlc-devel] demux: adaptive: fix a zero-divid bug.</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Xie,<br>
What's the version of VLC has this bug?<br>
If NearOptimalAdaptationLogic has this problem, then other <br>
AdaptationLogics have this problem too, so this patch is not complete.<br>
On the other hand, modules/demux/adaptive/http/Chunk.cpp doesn't call <br>
updateDownloadRate if time is zero. I don't know how this can happen.<br>
<br>
On 2018/11/15 下午6:49, Xie Zhigang wrote:<br>
> fixes crashs on some cases with zero update download rates.<br>
> ---<br>
>   modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp | 3 +++<br>
>   1 file changed, 3 insertions(+)<br>
><br>
> diff --git a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp<br>
> index 1c99538..32bb863 100644<br>
> --- a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp<br>
> +++ b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp<br>
> @@ -179,6 +179,9 @@ unsigned NearOptimalAdaptationLogic::getMaxCurrentBw() const<br>
>   <br>
>   void NearOptimalAdaptationLogic::updateDownloadRate(const ID &id, size_t dlsize, vlc_tick_t time)<br>
>   {<br>
> +    if (time <= 0)<br>
> +        return;<br>
> +<br>
>       vlc_mutex_lock(&lock);<br>
>       std::map<ID, NearOptimalContext>::iterator it = streams.find(id);<br>
>       if(it != streams.end())<br>
<br>
<br>
<br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></div>
</span></font></div>
</body>
</html>