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_faad.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_faad.c')
-rw-r--r-- | libmpcodecs/ad_faad.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libmpcodecs/ad_faad.c b/libmpcodecs/ad_faad.c index b681a9c7a3..80470d4a49 100644 --- a/libmpcodecs/ad_faad.c +++ b/libmpcodecs/ad_faad.c @@ -253,8 +253,13 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) } else { // packetized (.mp4) aac stream: unsigned char* bufptr=NULL; - int buflen=ds_get_packet(sh->ds, &bufptr); + double pts; + int buflen=ds_get_packet_pts(sh->ds, &bufptr, &pts); if(buflen<=0) break; + if (pts != MP_NOPTS_VALUE) { + sh->pts = pts; + sh->pts_bytes = 0; + } faac_sample_buffer = faacDecDecode(faac_hdec, &faac_finfo, bufptr, buflen); } //for (j=0;j<faac_finfo.channels;j++) printf("%d:%d\n", j, faac_finfo.channel_position[j]); @@ -271,6 +276,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) memcpy(buf+len,faac_sample_buffer, sh->samplesize*faac_finfo.samples); last_dec_len = sh->samplesize*faac_finfo.samples; len += last_dec_len; + sh->pts_bytes += last_dec_len; //printf("FAAD: buffer: %d bytes consumed: %d \n", k, faac_finfo.bytesconsumed); } } |