From 9c984b9594c29ecacf9a6c20f3280ecb83001263 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Tue, 29 Apr 2008 19:11:56 +0000 Subject: [PATCH] gst/subenc/gstsrtenc.c: Declare variables at the beginning of blocks. Fixes compilation with gcc 2.x and other compil... Original commit message from CVS: Patch by: Jens Granseuer * gst/subenc/gstsrtenc.c: (gst_srt_enc_timestamp_to_string): Declare variables at the beginning of blocks. Fixes compilation with gcc 2.x and other compilers. Fixes bug #530611. --- ChangeLog | 8 ++++++++ gst/subenc/gstsrtenc.c | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e27a4543d..7471879158 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-04-29 Sebastian Dröge + + Patch by: Jens Granseuer + + * gst/subenc/gstsrtenc.c: (gst_srt_enc_timestamp_to_string): + Declare variables at the beginning of blocks. Fixes compilation with + gcc 2.x and other compilers. Fixes bug #530611. + 2008-04-29 Zaheer Abbas Merali * gst/mpegtsparse/mpegtspacketizer.c: diff --git a/gst/subenc/gstsrtenc.c b/gst/subenc/gstsrtenc.c index c9923fd0ce..4077f7655c 100644 --- a/gst/subenc/gstsrtenc.c +++ b/gst/subenc/gstsrtenc.c @@ -63,16 +63,18 @@ GST_BOILERPLATE (GstSrtEnc, gst_srt_enc, GstElement, GST_TYPE_ELEMENT); static gchar * gst_srt_enc_timestamp_to_string (GstClockTime timestamp) { - guint h = timestamp / (3600 * GST_SECOND); + guint h, m, s, ms; + + h = timestamp / (3600 * GST_SECOND); timestamp -= h * 3600 * GST_SECOND; - guint m = timestamp / (60 * GST_SECOND); + m = timestamp / (60 * GST_SECOND); timestamp -= m * 60 * GST_SECOND; - guint s = timestamp / GST_SECOND; + s = timestamp / GST_SECOND; timestamp -= s * GST_SECOND; - guint ms = timestamp / GST_MSECOND; + ms = timestamp / GST_MSECOND; return g_strdup_printf ("%.2d:%.2d:%.2d,%.3d", h, m, s, ms); }