# HG changeset patch # User rtognimp # Date 1110400190 0 # Node ID 89031188b7b27efc83013fc0827f5abc88a7ad08 # Parent 0f4d98b3ea666c0033afaef5f11f8d412539bd36 Rather simple patch for RAWDV demuxer which lets it say whats the total movie length. Patch by Oded Shimon diff -r 0f4d98b3ea66 -r 89031188b7b2 libmpdemux/demux_rawdv.c --- a/libmpdemux/demux_rawdv.c Wed Mar 09 12:41:04 2005 +0000 +++ b/libmpdemux/demux_rawdv.c Wed Mar 09 20:29:50 2005 +0000 @@ -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 diff -r 0f4d98b3ea66 -r 89031188b7b2 libmpdemux/demuxer.c --- a/libmpdemux/demuxer.c Wed Mar 09 12:41:04 2005 +0000 +++ b/libmpdemux/demuxer.c Wed Mar 09 20:29:50 2005 +0000 @@ -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; }