[MPlayer-cvslog] CVS: main/libmpdemux demux_rawdv.c, 1.8, 1.9 demuxer.c, 1.183, 1.184
Roberto Togni CVS
syncmail at mplayerhq.hu
Wed Mar 9 21:29:52 CET 2005
CVS change done by Roberto Togni CVS
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv28095
Modified Files:
demux_rawdv.c demuxer.c
Log Message:
Rather simple patch for RAWDV demuxer which lets it say whats the total
movie length.
Patch by Oded Shimon
Index: demux_rawdv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_rawdv.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- demux_rawdv.c 7 Aug 2003 13:25:03 -0000 1.8
+++ demux_rawdv.c 9 Mar 2005 20:29:50 -0000 1.9
@@ -225,4 +225,22 @@
free(frames);
}
+int demux_rawdv_control(demuxer_t *demuxer,int cmd, void *arg) {
+ rawdv_frames_t *frames = (rawdv_frames_t *)demuxer->priv;
+ sh_video_t *sh_video=demuxer->video->sh;
+
+ switch(cmd) {
+ case DEMUXER_CTRL_GET_TIME_LENGTH:
+ *((unsigned long *)arg)=frames->frame_number / sh_video->fps;
+ return DEMUXER_CTRL_OK;
+
+ case DEMUXER_CTRL_GET_PERCENT_POS:
+ *((int *)arg)=(int)(frames->current_frame * 100. / frames->frame_number);
+ return DEMUXER_CTRL_OK;
+
+ default:
+ return DEMUXER_CTRL_NOTIMPL;
+ }
+}
+
#endif
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -r1.183 -r1.184
--- demuxer.c 13 Feb 2005 13:38:27 -0000 1.183
+++ demuxer.c 9 Mar 2005 20:29:50 -0000 1.184
@@ -1720,6 +1720,9 @@
#ifdef USE_WIN32DLL
extern int demux_avs_control(demuxer_t *demuxer, int cmd, void *arg);
#endif
+#ifdef HAVE_LIBDV095
+extern int demux_rawdv_control(demuxer_t *demuxer,int cmd, void *arg);
+#endif
int demux_control(demuxer_t *demuxer, int cmd, void *arg) {
switch(demuxer->type) {
@@ -1762,6 +1765,10 @@
case DEMUXER_TYPE_AVS:
return demux_avs_control(demuxer, cmd, arg);
#endif
+#ifdef HAVE_LIBDV095
+ case DEMUXER_TYPE_RAWDV:
+ return demux_rawdv_control(demuxer,cmd, arg);
+#endif
default:
return DEMUXER_CTRL_NOTIMPL;
}
More information about the MPlayer-cvslog
mailing list