changeset 15308:e9865b828a89

LIBAVFORMAT_BUILD >= 4624
author michael
date Sun, 01 May 2005 02:03:58 +0000
parents 58bd9c33864c
children cfbd8e4b3ede
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sat Apr 30 22:41:41 2005 +0000
+++ b/libmpdemux/demux_lavf.c	Sun May 01 02:03:58 2005 +0000
@@ -236,8 +236,13 @@
             sh_video->bih= bih;
             sh_video->disp_w= codec->width;
             sh_video->disp_h= codec->height;
+#if LIBAVFORMAT_BUILD >= 4624
+            sh_video->video.dwRate= codec->time_base.den;
+            sh_video->video.dwScale= codec->time_base.num;
+#else
             sh_video->video.dwRate= codec->frame_rate;
             sh_video->video.dwScale= codec->frame_rate_base;
+#endif
             sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
             sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
             sh_video->format = bih->biCompression;
@@ -339,8 +344,13 @@
     }
 
     if(pkt.pts != AV_NOPTS_VALUE){
+#if LIBAVFORMAT_BUILD >= 4624
+        dp->pts=pkt.pts * av_q2d(priv->avfc->streams[id]->time_base);
+        priv->last_pts= dp->pts * AV_TIME_BASE;
+#else
         priv->last_pts= pkt.pts;
         dp->pts=pkt.pts / (float)AV_TIME_BASE;
+#endif
     }
     dp->pos=demux->filepos;
     dp->flags= !!(pkt.flags&PKT_FLAG_KEY);