Stream Position Data in Xine
This is pretty easy, once you figure out where to look. In the xine-ui source, go into
src/xitk/stdctl.c. In the function
xine_stdctl_loop, change the line:
int secs, last_secs;to
int secs, last_secs, len_secs, stream_pos;
Just below that, you should see where
last_secsis initialized to 1. Copy that line twice and replace
Near the end of that function, replace the call to
gui_xine_get_pos_length( gGui->stream, &stream_pos, &secs, &len_secs ). Divide
len_secsby 1000 afterwards, as is already done with
Replace the call to
fprintf(stdout, "time\t%d\t%d\n", secs, len_secs).
make && make installto deploy your changes.
Finally, Xine suppresses output to standard out (stdout) shortly after it prints its introductory banner/copyright data. The easiest way to prevent this is by prepending the
--verboseoption to the command line. A slightly cleaner way (only cleaner in terms of the output) is to run
make clean && make debug && make install_debugto deploy your changes instead. If everything's working right, you should see a bunch of lines like this displayed on the screen:
time 0 97
time 1 97
time 2 97
The first number is the current position in seconds in the current stream and the second is the length of the current stream, in seconds.