GNOME Bugzilla – Bug 751911
dashdemux: mimeType local variable must be reinitialized at the beginning of loop iteration
Last modified: 2015-08-16 13:39:16 UTC
in gst_mpdparser_get_list_and_nb_of_audio_language function, the mimeType variable is used inside a loop. It must be set to NULL at the beginning of each iteration. Otherwise, the value from the previous iteration might influence the decisions of the current iteration.
Created attachment 306722 [details] [review] proposed patch
Review of attachment 306722 [details] [review]: ::: ext/dash/gstmpdparser.c @@ +4475,3 @@ list = g_list_next (list)) { adapt_set = (GstAdaptationSetNode *) list->data; + if (adapt_set && adapt_set->lang) { This change doesn't seem related and why are you enforcing having lang set?
it's a code optimization. If the lang is not set, the loop will not do anything. So we test the lag at the beginning to avoid calling gst_mpdparser_get_lowest_representation and check the mimeType for nothing.
commit 5151c42085dacfa2c0f4df07d8e27db1036c91e8 Author: Florin Apostol <florin.apostol@oregan.net> Date: Fri Jul 3 16:10:20 2015 +0100 dashdemux: corrected search for audio languages Corrected the initialisation of mimeType in gst_mpdparser_get_list_and_nb_of_audio_language: the variable is used in a loop, so it must be set to NULL at the beginning of each iteration. https://bugzilla.gnome.org/show_bug.cgi?id=751911