Mercurial > mplayer.hg
comparison mplayer.c @ 10223:b89d03e939d6
display pts for audio-only files as hh:mm:ss.f
patch by Robert Riches (rm.riches at verizon.net)
author | rfelker |
---|---|
date | Sat, 31 May 2003 20:52:16 +0000 |
parents | beeed3a9606e |
children | 785c945f6796 |
comparison
equal
deleted
inserted
replaced
10222:ae9dd35f693b | 10223:b89d03e939d6 |
---|---|
1927 break; | 1927 break; |
1928 } // while(sh_audio) | 1928 } // while(sh_audio) |
1929 | 1929 |
1930 if(!sh_video) { | 1930 if(!sh_video) { |
1931 // handle audio-only case: | 1931 // handle audio-only case: |
1932 if(!quiet) mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f %4.1f%% %d%% \r" | 1932 if(!quiet) { |
1933 ,sh_audio->delay-audio_out->get_delay() | 1933 // |
1934 // convert time to HH:MM:SS.F format | |
1935 // | |
1936 long tenths = 10 * sh_audio->delay-audio_out->get_delay(); | |
1937 int hh = (tenths / 36000) % 100; | |
1938 int mm = (tenths / 600) % 60; | |
1939 int ss = (tenths / 10) % 60; | |
1940 int f1 = tenths % 10; | |
1941 char hhmmssf[16]; // only really need 11, but just in case... | |
1942 sprintf( hhmmssf, "%2d:%2d:%2d.%1d", hh, mm, ss, f1); | |
1943 if (0 == hh) { | |
1944 hhmmssf[1] = ' '; | |
1945 hhmmssf[2] = ' '; | |
1946 } | |
1947 // uncomment the next three lines to show leading zero ten-hours | |
1948 // else if (' ' == hhmmssf[0]) { | |
1949 // hhmmssf[0] = '0'; | |
1950 // } | |
1951 if ((0 == hh) && (0 == mm)) { | |
1952 hhmmssf[4] = ' '; | |
1953 hhmmssf[5] = ' '; | |
1954 } | |
1955 else if ((' ' == hhmmssf[3]) && (' ' != hhmmssf[2])) { | |
1956 hhmmssf[3] = '0'; | |
1957 } | |
1958 if ((' ' == hhmmssf[6]) && (' ' != hhmmssf[5])) { | |
1959 hhmmssf[6] = '0'; | |
1960 } | |
1961 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A: %s %4.1f%% %d%% \r" | |
1962 ,hhmmssf | |
1934 ,(sh_audio->delay>0.5)?100.0*audio_time_usage/(double)sh_audio->delay:0 | 1963 ,(sh_audio->delay>0.5)?100.0*audio_time_usage/(double)sh_audio->delay:0 |
1935 ,cache_fill_status | 1964 ,cache_fill_status |
1936 ); | 1965 ); |
1966 } | |
1937 if(d_audio->eof) eof = PT_NEXT_ENTRY; | 1967 if(d_audio->eof) eof = PT_NEXT_ENTRY; |
1938 | 1968 |
1939 } else { | 1969 } else { |
1940 | 1970 |
1941 /*========================== PLAY VIDEO ============================*/ | 1971 /*========================== PLAY VIDEO ============================*/ |