[FFmpeg-cvslog] r19880 - trunk/ffmpeg.c

faust3 subversion
Wed Sep 16 14:45:24 CEST 2009


Author: faust3
Date: Wed Sep 16 14:45:24 2009
New Revision: 19880

Log:
fix PTS calculation for audio formats with bits per sample != 16

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Wed Sep 16 14:26:59 2009	(r19879)
+++ trunk/ffmpeg.c	Wed Sep 16 14:45:24 2009	(r19880)
@@ -1257,6 +1257,7 @@ static int output_packet(AVInputStream *
     AVSubtitle subtitle, *subtitle_to_free;
     int got_subtitle;
     AVPacket avpkt;
+    int bps = av_get_bits_per_sample_format(ist->st->codec->sample_fmt)>>3;
 
     if(ist->next_pts == AV_NOPTS_VALUE)
         ist->next_pts= ist->pts;
@@ -1310,7 +1311,7 @@ static int output_packet(AVInputStream *
                     continue;
                 }
                 data_buf = (uint8_t *)samples;
-                ist->next_pts += ((int64_t)AV_TIME_BASE/2 * data_size) /
+                ist->next_pts += ((int64_t)AV_TIME_BASE/bps * data_size) /
                     (ist->st->codec->sample_rate * ist->st->codec->channels);
                 break;}
             case CODEC_TYPE_VIDEO:



More information about the ffmpeg-cvslog mailing list