[MPlayer-cvslog] CVS: main/libmpdemux demuxer.c,1.177,1.178
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Tue Dec 21 13:26:01 CET 2004
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv13575/libmpdemux
Modified Files:
demuxer.c
Log Message:
Use demuxer_get_percent_pos for the OSD position bar
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -r1.177 -r1.178
--- demuxer.c 15 Dec 2004 18:39:51 -0000 1.177
+++ demuxer.c 21 Dec 2004 12:25:59 -0000 1.178
@@ -1642,6 +1642,7 @@
extern int demux_ogg_control(demuxer_t *demuxer, int cmd, void *arg);
extern int demux_real_control(demuxer_t *demuxer, int cmd, void *arg);
extern int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg);
+extern int demux_mov_control(demuxer_t *demuxer, int cmd, void *arg);
int demux_control(demuxer_t *demuxer, int cmd, void *arg) {
switch(demuxer->type) {
@@ -1678,6 +1679,8 @@
case DEMUXER_TYPE_LAVF:
return demux_lavf_control(demuxer, cmd, arg);
#endif
+ case DEMUXER_TYPE_MOV:
+ return demux_mov_control(demuxer, cmd, arg);
default:
return DEMUXER_CTRL_NOTIMPL;
@@ -1695,10 +1698,11 @@
}
int demuxer_get_percent_pos(demuxer_t *demuxer){
- int ans;
- if (demux_control(demuxer, DEMUXER_CTRL_GET_PERCENT_POS, &ans)<=0) {
- ans=0;
- }
+ int ans = 0;
+ int res = demux_control(demuxer, DEMUXER_CTRL_GET_PERCENT_POS, &ans);
+ int len = (demuxer->movi_end - demuxer->movi_start) / 100;
+ if (res == DEMUXER_CTRL_NOTIMPL && len > 0)
+ ans = (demuxer->filepos - demuxer->movi_start) / len;
if (ans>100 || ans<0) ans=0;
return ans;
}
More information about the MPlayer-cvslog
mailing list