diff options
author | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-05-31 12:42:02 +0000 |
---|---|---|
committer | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-05-31 12:42:02 +0000 |
commit | be63729ba5547fea0a557a44cb0d8b50be32d1fb (patch) | |
tree | 80772343d909e7ebe8cbb0ad203b1f01a4430f7f /command.c | |
parent | 67341d23faebad3d3cff8fee5ad0f9c4f0c508e1 (diff) | |
download | mpv-be63729ba5547fea0a557a44cb0d8b50be32d1fb.tar.bz2 mpv-be63729ba5547fea0a557a44cb0d8b50be32d1fb.tar.xz |
Move the time printing code out of the length property.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23434 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 23 |
1 files changed, 1 insertions, 22 deletions
@@ -283,28 +283,7 @@ static int mp_property_length(m_option_t * prop, int action, void *arg, !(int) (len = demuxer_get_time_length(mpctx->demuxer))) return M_PROPERTY_UNAVAILABLE; - switch (action) { - case M_PROPERTY_PRINT: - if (!arg) - return M_PROPERTY_ERROR; - else { - int h, m, s = len; - h = s / 3600; - s -= h * 3600; - m = s / 60; - s -= m * 60; - *(char **) arg = malloc(20); - if (h > 0) - sprintf(*(char **) arg, "%d:%02d:%02d", h, m, s); - else if (m > 0) - sprintf(*(char **) arg, "%d:%02d", m, s); - else - sprintf(*(char **) arg, "%d", s); - return M_PROPERTY_OK; - } - break; - } - return m_property_double_ro(prop, action, arg, len); + return m_property_time_ro(prop, action, arg, len); } /// Demuxer meta data |