summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJai Menon <jmenon86@gmail.com>2008-09-09 14:42:50 +0000
committerJai Menon <jmenon86@gmail.com>2008-09-09 14:42:50 +0000
commit91ba93e68b324e387eda914c7383b5e18b1df002 (patch)
tree26f5bf2faa50a6aff156e430a3c2e21602295e60
parentc16582579b1c6f66a86615c5808cd5b2bf17be73 (diff)
vorbis_enc : set coded_frame->pts value to running sample count.
This is a temporary fix for issue 502 and will not be required when we start using AVFrame for audio codecs. Originally committed as revision 15285 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/vorbis_enc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c
index 3d63785724..01bc48c326 100644
--- a/libavcodec/vorbis_enc.c
+++ b/libavcodec/vorbis_enc.c
@@ -118,6 +118,8 @@ typedef struct {
int nmodes;
vorbis_mode_t * modes;
+
+ int64_t sample_count;
} venc_context_t;
typedef struct {
@@ -1010,6 +1012,8 @@ static int vorbis_encode_frame(AVCodecContext * avccontext, unsigned char * pack
residue_encode(venc, &venc->residues[mapping->residue[mapping->mux[0]]], &pb, venc->coeffs, samples, venc->channels);
+ avccontext->coded_frame->pts = venc->sample_count;
+ venc->sample_count += avccontext->frame_size;
flush_put_bits(&pb);
return (put_bits_count(&pb) + 7) / 8;
}