hlsdemux: send packet failed, could not drain decoder after switching bitrate while using a libav aac decoder
Hi,
I'm modifying Android tutorial 5 for a HLS player. The branch used is 1.16.1.
I encountered the issue in #189, so I do not use omx.google.aac.decoder. I use decoder from libav instead.
Now the player plays HLS links with a constant connection-speed perfectly. But if hlsdemux switches bitrate, buffering drops under 10% immediately.
I examined the following logs, it seams that gstavauddec cannot drain decoder after switching bitrate, which leads to the buffering problem.
I'm not sure whether this is a bug of hlsdemux or a bug of gst-libav.
---- Logs starts here ----
19:04:03.201 V [InulPlayer] setMessage: Buffering 98%
19:04:03.204 V [InulPlayer] setMessage: Buffering 99%
19:04:03.961 V [InulPlayer] setMessage: State changed to PLAYING
...
19:04:09.139 I ┌ 0:00:38.359795268 0x8a66ab80 ../ext/hls/gsthlsdemux.c:1601:gst_hls_demux_
19:04:09.139 I ├ change_playlist:<hlsdemux0> Client was on 1500000bps, max allowed is 1134
19:04:09.139 I └ 260bps, switching to bitrate 800000bps
...
19:04:14.177 W ┌ 0:00:43.397305312 0x7cbf4db0 ../ext/libav/gstavauddec.c:628:gst_ffmpegaud
19:04:14.177 W └ dec_drain:<avdec_aac0> send packet failed, could not drain decoder
19:04:14.957 I Rkvpu_SendInputData(449): send eos
19:04:15.361 V [InulPlayer] setMessage: Buffering 5%
19:04:15.362 V [InulPlayer] setMessage: Buffering 10%
19:04:15.362 V [InulPlayer] setMessage: Buffering 11%
19:04:15.363 V [InulPlayer] setMessage: Buffering 12%
19:04:15.383 I ┌ 0:00:44.601697021 0x7cb9c980 ../gst/playback/gstplaybin2.c:3779:no_more_p
19:04:15.383 I └ ads_cb:<playbin0> setting custom audio sink <openslessink0>
19:04:15.383 I ┌ 0:00:44.603441188 0x7cb9c980 ../gst/playback/gstplaybin2.c:3786:no_more_p
19:04:15.383 I └ ads_cb:<playbin0> setting custom video sink <glimagesinkbin0>
19:04:15.384 V [InulPlayer] setMessage: Buffering 13%
19:04:15.402 V [InulPlayer] setMessage: Buffering 14%
Edited by Sirius Wu