# HG changeset patch # User ib # Date 1304939863 0 # Node ID b433bc008e23b35413b64348b4407d3251c9333e # Parent c36ab8db37f60ada031848adc4ffa763f88ed622 Check for reasonable time values. Some A/V files don't provide reasonable time information in which case the GUI produces a junk dlabel, so set values to zero. diff -r c36ab8db37f6 -r b433bc008e23 gui/mplayer/gui_common.c --- a/gui/mplayer/gui_common.c Sun May 08 18:44:43 2011 +0000 +++ b/gui/mplayer/gui_common.c Mon May 09 11:17:43 2011 +0000 @@ -154,6 +154,8 @@ case '1': t = guiIntfStruct.TimeSec; calclengthhhmmss: + if (t < 0) + t = 0; snprintf(tmp, sizeof(tmp), "%02d:%02d:%02d", t / 3600, t / 60 % 60, t % 60); av_strlcat(trbuf, tmp, sizeof(trbuf)); break; @@ -165,6 +167,8 @@ case '2': t = guiIntfStruct.TimeSec; calclengthmmmmss: + if (t < 0) + t = 0; snprintf(tmp, sizeof(tmp), "%04d:%02d", t / 60, t % 60); av_strlcat(trbuf, tmp, sizeof(trbuf)); break; @@ -185,7 +189,10 @@ break; case '8': - snprintf(tmp, sizeof(tmp), "%01d:%02d:%02d", guiIntfStruct.TimeSec / 3600, (guiIntfStruct.TimeSec / 60) % 60, guiIntfStruct.TimeSec % 60); + t = guiIntfStruct.TimeSec; + if (t < 0) + t = 0; + snprintf(tmp, sizeof(tmp), "%01d:%02d:%02d", t / 3600, (t / 60) % 60, t % 60); av_strlcat(trbuf, tmp, sizeof(trbuf)); break;