[MPlayer-cvslog] CVS: main/libmpdemux demux_asf.c, 1.33, 1.34 demux_audio.c, 1.37, 1.38 demux_avi.c, 1.65, 1.66 demux_avs.c, 1.5, 1.6 demux_lavf.c, 1.20, 1.21 demux_mkv.c, 1.47, 1.48 demux_mov.c, 1.128, 1.129 demux_mpg.c, 1.62, 1.63 demux_ogg.c, 1.76, 1.77 demux_rawdv.c, 1.10, 1.11 demux_real.c, 1.72, 1.73 demux_ty.c, 1.7, 1.8 demux_xmms.c, 1.11, 1.12 demuxer.c, 1.201, 1.202 demuxer.h, 1.81, 1.82

Oded Shimon CVS syncmail at mplayerhq.hu
Fri Sep 2 10:32:36 CEST 2005


CVS change done by Oded Shimon CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv31339/libmpdemux

Modified Files:
	demux_asf.c demux_audio.c demux_avi.c demux_avs.c demux_lavf.c 
	demux_mkv.c demux_mov.c demux_mpg.c demux_ogg.c demux_rawdv.c 
	demux_real.c demux_ty.c demux_xmms.c demuxer.c demuxer.h 
Log Message:
Make -identify's 'ID_LENGTH=' print a float and not an integer.. The 
accuracey may be totally fake for some demuxers (mpg), but accurate for 
others.. (avi)


Index: demux_asf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_asf.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- demux_asf.c	5 Aug 2005 19:57:46 -0000	1.33
+++ demux_asf.c	2 Sep 2005 08:32:31 -0000	1.34
@@ -422,7 +422,7 @@
 */
     switch(cmd) {
 	case DEMUXER_CTRL_GET_TIME_LENGTH:
-	    *((unsigned long *)arg)=(unsigned long)(asf_movielength);
+	    *((double *)arg)=(double)(asf_movielength);
 	    return DEMUXER_CTRL_OK;
 
 	case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_audio.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- demux_audio.c	5 Aug 2005 19:57:46 -0000	1.37
+++ demux_audio.c	2 Sep 2005 08:32:32 -0000	1.38
@@ -543,7 +543,7 @@
     switch(cmd) {
 	case DEMUXER_CTRL_GET_TIME_LENGTH:
 	    if (audio_length<=0) return DEMUXER_CTRL_DONTKNOW;
-	    *((unsigned long *)arg)=(unsigned long)audio_length;
+	    *((double *)arg)=(double)audio_length;
 	    return DEMUXER_CTRL_GUESS;
 
 	case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_avi.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- demux_avi.c	13 Aug 2005 12:20:07 -0000	1.65
+++ demux_avi.c	2 Sep 2005 08:32:32 -0000	1.66
@@ -850,7 +850,7 @@
     switch(cmd) {
 	case DEMUXER_CTRL_GET_TIME_LENGTH:
     	    if (!priv->numberofframes) return DEMUXER_CTRL_DONTKNOW;
-	    *((unsigned long *)arg)=priv->numberofframes/sh_video->fps;
+	    *((double *)arg)=(double)priv->numberofframes/sh_video->fps;
 	    if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS;
 	    return DEMUXER_CTRL_OK;
 

Index: demux_avs.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_avs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- demux_avs.c	5 Aug 2005 19:57:46 -0000	1.5
+++ demux_avs.c	2 Sep 2005 08:32:32 -0000	1.6
@@ -343,7 +343,7 @@
         case DEMUXER_CTRL_GET_TIME_LENGTH:
         {
             if (!AVS->video_info->num_frames) return DEMUXER_CTRL_DONTKNOW;
-            *((unsigned long *)arg) = AVS->video_info->num_frames / sh_video->fps;
+            *((double *)arg) = (double)AVS->video_info->num_frames / sh_video->fps;
             return DEMUXER_CTRL_OK;
         }
         case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_lavf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_lavf.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- demux_lavf.c	5 Aug 2005 19:57:46 -0000	1.20
+++ demux_lavf.c	2 Sep 2005 08:32:32 -0000	1.21
@@ -402,7 +402,7 @@
 	    if (priv->avfc->duration == 0)
 	        return DEMUXER_CTRL_DONTKNOW;
 	    
-	    *((unsigned long *)arg) = priv->avfc->duration / AV_TIME_BASE;
+	    *((double *)arg) = (double)priv->avfc->duration / AV_TIME_BASE;
 	    return DEMUXER_CTRL_OK;
 
 	case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_mkv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- demux_mkv.c	24 Aug 2005 12:33:32 -0000	1.47
+++ demux_mkv.c	2 Sep 2005 08:32:32 -0000	1.48
@@ -3280,7 +3280,7 @@
       if (mkv_d->duration == 0)
         return DEMUXER_CTRL_DONTKNOW;
 
-      *((unsigned long *)arg) = (unsigned long)mkv_d->duration;
+      *((double *)arg) = (double)mkv_d->duration;
       return DEMUXER_CTRL_OK;
 
     case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -r1.128 -r1.129
--- demux_mov.c	31 Aug 2005 13:04:22 -0000	1.128
+++ demux_mov.c	2 Sep 2005 08:32:32 -0000	1.129
@@ -2016,7 +2016,7 @@
     case DEMUXER_CTRL_GET_TIME_LENGTH:
       if (!track->timescale)
         return DEMUXER_CTRL_DONTKNOW;
-      *((unsigned long *)arg) = track->length / track->timescale;
+      *((double *)arg) = (double)track->length / track->timescale;
       return DEMUXER_CTRL_OK;
 
     case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mpg.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- demux_mpg.c	26 Aug 2005 22:53:59 -0000	1.62
+++ demux_mpg.c	2 Sep 2005 08:32:32 -0000	1.63
@@ -751,7 +751,7 @@
     switch(cmd) {
 	case DEMUXER_CTRL_GET_TIME_LENGTH:
             if (mpg_d && mpg_d->has_valid_timestamps) {
-              *((unsigned long *)arg)=(long)mpg_d->final_pts;
+              *((double *)arg)=(double)mpg_d->final_pts;
               return DEMUXER_CTRL_GUESS;
             }
     		return DEMUXER_CTRL_DONTKNOW;

Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- demux_ogg.c	5 Aug 2005 19:57:46 -0000	1.76
+++ demux_ogg.c	2 Sep 2005 08:32:32 -0000	1.77
@@ -1605,7 +1605,7 @@
     switch(cmd) {
 	case DEMUXER_CTRL_GET_TIME_LENGTH:
 	    if (ogg_d->final_granulepos<=0) return DEMUXER_CTRL_DONTKNOW;
-	    *((unsigned long *)arg)=ogg_d->final_granulepos / rate;
+	    *((double *)arg)=(double)ogg_d->final_granulepos / rate;
 	    return DEMUXER_CTRL_GUESS;
 
 	case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_rawdv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_rawdv.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- demux_rawdv.c	5 Aug 2005 19:57:46 -0000	1.10
+++ demux_rawdv.c	2 Sep 2005 08:32:32 -0000	1.11
@@ -234,7 +234,7 @@
 
     switch(cmd) {
         case DEMUXER_CTRL_GET_TIME_LENGTH:
-            *((unsigned long *)arg)=frames->frame_number / sh_video->fps;
+            *((double *)arg)=(double)frames->frame_number / sh_video->fps;
             return DEMUXER_CTRL_OK;
 
         case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_real.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_real.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- demux_real.c	5 Aug 2005 19:57:46 -0000	1.72
+++ demux_real.c	2 Sep 2005 08:32:32 -0000	1.73
@@ -1855,7 +1855,7 @@
 	    if (priv->duration == 0)
 	        return DEMUXER_CTRL_DONTKNOW;
 	    
-	    *((unsigned long *)arg) = priv->duration;
+	    *((double *)arg) = (double)priv->duration;
 	    return DEMUXER_CTRL_OK;
 
 	case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_ty.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ty.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- demux_ty.c	5 Aug 2005 19:57:47 -0000	1.7
+++ demux_ty.c	2 Sep 2005 08:32:32 -0000	1.8
@@ -1350,8 +1350,8 @@
 	   case DEMUXER_CTRL_GET_TIME_LENGTH:
 	      if(!sh_video->i_bps)  // unspecified or VBR 
     		   return DEMUXER_CTRL_DONTKNOW;
-	      *((unsigned long *)arg)=
-            (demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps;
+	      *((double *)arg)=
+            ((double)demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps;
 	      return DEMUXER_CTRL_GUESS;
 
 	   case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demux_xmms.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_xmms.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- demux_xmms.c	5 Aug 2005 19:57:47 -0000	1.11
+++ demux_xmms.c	2 Sep 2005 08:32:32 -0000	1.12
@@ -341,7 +341,7 @@
     switch(cmd) {
 	case DEMUXER_CTRL_GET_TIME_LENGTH:
 	    if (xmms_length<=0) return DEMUXER_CTRL_DONTKNOW;
-	    *((unsigned long *)arg)=(unsigned long)xmms_length/1000;
+	    *((double *)arg)=(double)xmms_length/1000;
 	    return DEMUXER_CTRL_GUESS;
 
 	case DEMUXER_CTRL_GET_PERCENT_POS:

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -r1.201 -r1.202
--- demuxer.c	31 Aug 2005 13:04:22 -0000	1.201
+++ demuxer.c	2 Sep 2005 08:32:32 -0000	1.202
@@ -918,13 +918,13 @@
 
 
 
-unsigned long demuxer_get_time_length(demuxer_t *demuxer){     
-    unsigned long get_time_ans;     
+double demuxer_get_time_length(demuxer_t *demuxer){
+    double get_time_ans;
     sh_video_t *sh_video = demuxer->video->sh;
     // <= 0 means DEMUXER_CTRL_NOTIMPL or DEMUXER_CTRL_DONTKNOW
     if (demux_control(demuxer, DEMUXER_CTRL_GET_TIME_LENGTH,(void *)&get_time_ans)<=0)  {
       if (sh_video && sh_video->i_bps)
-        get_time_ans = (demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps;
+        get_time_ans = (double)(demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps;
       else
         get_time_ans=0;     
     }

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- demuxer.h	30 Aug 2005 23:56:24 -0000	1.81
+++ demuxer.h	2 Sep 2005 08:32:32 -0000	1.82
@@ -320,7 +320,7 @@
 
 #endif
 
-extern unsigned long demuxer_get_time_length(demuxer_t *demuxer);
+extern double demuxer_get_time_length(demuxer_t *demuxer);
 extern int demuxer_get_percent_pos(demuxer_t *demuxer);
 extern int demuxer_switch_audio(demuxer_t *demuxer, int index);
 




More information about the MPlayer-cvslog mailing list