GNOME Bugzilla – Bug 751153
dashdemux: wrong representation index returned when max_bandwidth is 0
Last modified: 2015-06-18 14:37:26 UTC
In gst_mpdparser_get_rep_idx_with_max_bandwidth function, if max_bandwidth is <= 0, the function will return the first representation, but the comment says it is intended to return the minimum representation.
if (max_bandwidth <= 0) /* 0 => get lowest representation available */
There is no mention in the standard that representations are ordered by their bandwidth, so one of them is wrong. I suspect the comment is correct and the function should return the lowest representation available, not the first one.
Created attachment 305553 [details] [review]
patch containing unit test and fix
attached is a patch containing a unit test reproducing the problem and a proposed fix.
Pushed, thanks for the patch with unit tests!
Author: Florin Apostol <firstname.lastname@example.org>
Date: Thu Jun 18 13:08:25 2015 +0100
dashdemux: fixed getting representation based on max bandwidth
The gst_mpdparser_get_rep_idx_with_max_bandwidth function assumes
representations are ordered by bandwidth and incorrectly returns the
first one when wanting the one with minimum bandwidth.
Corrected gst_mpdparser_get_rep_idx_with_max_bandwidth function to get the
correct representation in case max_bandwidth parameter is 0.