diff options
author | rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-04-24 10:58:40 +0000 |
---|---|---|
committer | rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-04-24 10:58:40 +0000 |
commit | 6c4d9bfe5127da2a4e2afbe1d6e585ebeb7c5949 (patch) | |
tree | 6057e1a4875492c40543d4ac2e43adbbd53afff2 /libmpcodecs/ad_libvorbis.c | |
parent | 4b45ec30e4b8ced93aa10792aa18a8f96b3cd104 (diff) | |
download | mpv-6c4d9bfe5127da2a4e2afbe1d6e585ebeb7c5949.tar.bz2 mpv-6c4d9bfe5127da2a4e2afbe1d6e585ebeb7c5949.tar.xz |
4 - Implement a better way to calculate current audio pts and use it for
audio decoded with ad_libvorbis, ad_ffmpeg and ad_faad.
Patch by Uoti Urpala
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18243 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/ad_libvorbis.c')
-rw-r--r-- | libmpcodecs/ad_libvorbis.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libmpcodecs/ad_libvorbis.c b/libmpcodecs/ad_libvorbis.c index 3c765b6acd..2d94ac4431 100644 --- a/libmpcodecs/ad_libvorbis.c +++ b/libmpcodecs/ad_libvorbis.c @@ -229,9 +229,14 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) while(len < minlen) { while((samples=vorbis_synthesis_pcmout(&ov->vd,&pcm))<=0){ ogg_packet op; + double pts; memset(&op,0,sizeof(op)); //op.b_o_s = op.e_o_s = 0; - op.bytes = ds_get_packet(sh->ds,&op.packet); + op.bytes = ds_get_packet_pts(sh->ds,&op.packet, &pts); if(op.bytes<=0) break; + if (pts != MP_NOPTS_VALUE) { + sh->pts = pts; + sh->pts_bytes = 0; + } if(vorbis_synthesis(&ov->vb,&op)==0) /* test for success! */ vorbis_synthesis_blockin(&ov->vd,&ov->vb); } @@ -303,6 +308,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) if(clipflag) mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"Clipping in frame %ld\n",(long)(ov->vd.sequence)); len+=2*ov->vi.channels*bout; + sh->pts_bytes += 2*ov->vi.channels*bout; mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"\n[decoded: %d / %d ]\n",bout,samples); samples-=bout; vorbis_synthesis_read(&ov->vd,bout); /* tell libvorbis how |