Changeset 253fe31c5a1b4ea79638dd545f36f1bb7afa98cb
- Timestamp:
- 26/10/07 06:37:38
(1 year ago)
- Author:
- Jean-Baptiste Kempf <jb@videolan.org>
- git-committer:
- Jean-Baptiste Kempf <jb@videolan.org> 1193373458 +0000
- git-parent:
[3b6a320b107921cee152bc0c514ea87cb93c9420]
- git-author:
- Jean-Baptiste Kempf <jb@videolan.org> 1193373458 +0000
- Message:
Don't show h: in h:mm:ss when h is 0 in secstotimestr.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r6479d4f |
r253fe31 |
|
| 116 | 116 | char *secstotimestr( char *psz_buffer, int i_seconds ) |
|---|
| 117 | 117 | { |
|---|
| 118 | | snprintf( psz_buffer, MSTRTIME_MAX_SIZE, "%d:%2.2d:%2.2d", |
|---|
| 119 | | (int) (i_seconds / (60 *60)), |
|---|
| 120 | | (int) ((i_seconds / 60) % 60), |
|---|
| 121 | | (int) (i_seconds % 60) ); |
|---|
| | 118 | int i_hours, i_mins; |
|---|
| | 119 | i_mins = i_seconds / 60; |
|---|
| | 120 | i_hours = i_mins / 60 ; |
|---|
| | 121 | if( i_hours ) |
|---|
| | 122 | { |
|---|
| | 123 | snprintf( psz_buffer, MSTRTIME_MAX_SIZE, "%d:%2.2d:%2.2d", |
|---|
| | 124 | (int) i_hours, |
|---|
| | 125 | (int) (i_mins % 60), |
|---|
| | 126 | (int) (i_seconds % 60) ); |
|---|
| | 127 | } |
|---|
| | 128 | else |
|---|
| | 129 | { |
|---|
| | 130 | snprintf( psz_buffer, MSTRTIME_MAX_SIZE, "%2.2d:%2.2d", |
|---|
| | 131 | (int) i_mins , |
|---|
| | 132 | (int) (i_seconds % 60) ); |
|---|
| | 133 | } |
|---|
| 122 | 134 | return( psz_buffer ); |
|---|
| 123 | 135 | } |
|---|