dashdemux: Don't declare variables inside the for loop header

This is a C99 feature.
This commit is contained in:
Sebastian Dröge 2016-12-13 22:21:25 +02:00
parent 7360c93de1
commit 788bb67639
2 changed files with 10 additions and 4 deletions

View file

@ -2853,13 +2853,15 @@ gst_dash_demux_parse_http_head (GstDashDemuxClockDrift * clock_drift,
&hour, &minute, &second, zone);
if (ret == 7) {
gchar *z = zone;
for (int i = 1; months[i]; ++i) {
gint i;
for (i = 1; months[i]; ++i) {
if (g_ascii_strncasecmp (months[i], monthstr, strlen (months[i])) == 0) {
month = i;
break;
}
}
for (int i = 0; timezones[i].name && !parsed_tz; ++i) {
for (i = 0; timezones[i].name && !parsed_tz; ++i) {
if (g_ascii_strncasecmp (timezones[i].name, z,
strlen (timezones[i].name)) == 0) {
tzoffset = timezones[i].tzoffset;

View file

@ -2238,7 +2238,9 @@ gst_mpdparser_parse_utctiming_node (GList ** list, xmlNode * a_node)
GST_LOG ("attributes of UTCTiming node:");
if (gst_mpdparser_get_xml_prop_string (a_node, "schemeIdUri", &method)) {
for (int i = 0; gst_mpdparser_utc_timing_methods[i].name; ++i) {
int i;
for (i = 0; gst_mpdparser_utc_timing_methods[i].name; ++i) {
if (g_ascii_strncasecmp (gst_mpdparser_utc_timing_methods[i].name,
method, strlen (gst_mpdparser_utc_timing_methods[i].name)) == 0) {
new_timing->method = gst_mpdparser_utc_timing_methods[i].method;
@ -4107,7 +4109,9 @@ gst_mpd_client_setup_representation (GstMpdClient * client,
/* clip duration of segments to stop at period end */
if (stream->segments && stream->segments->len) {
if (GST_CLOCK_TIME_IS_VALID (PeriodEnd)) {
for (guint n = 0; n < stream->segments->len; ++n) {
guint n;
for (n = 0; n < stream->segments->len; ++n) {
GstMediaSegment *media_segment =
g_ptr_array_index (stream->segments, n);
if (media_segment) {