diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-05 16:46:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-05 16:46:47 +0200 |
commit | 47550e62bf717ed626b652bd3797fcae0ca8c335 (patch) | |
tree | 0aac16a6e3cdfc9bc108844becd185d0ad2a21fb | |
parent | ba040d4c8c1e9d55d12a6759bfa4932c11454da4 (diff) | |
download | ffmpeg-47550e62bf717ed626b652bd3797fcae0ca8c335.tar.gz |
avformat/astenc: avoid using AVCodecContext.frame_number
Theres no gurantee that the user application has initialized it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/astenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/astenc.c b/libavformat/astenc.c index edd802cbf3..cf7a12c95d 100644 --- a/libavformat/astenc.c +++ b/libavformat/astenc.c @@ -113,7 +113,7 @@ static int ast_write_packet(AVFormatContext *s, AVPacket *pkt) AVCodecContext *enc = s->streams[0]->codec; int size = pkt->size / enc->channels; - if (enc->frame_number == 1) + if (s->streams[0]->nb_frames == 0) ast->fbs = size; ffio_wfourcc(pb, "BLCK"); @@ -135,7 +135,7 @@ static int ast_write_trailer(AVFormatContext *s) ASTMuxContext *ast = s->priv_data; AVCodecContext *enc = s->streams[0]->codec; int64_t file_size = avio_tell(pb); - int64_t samples = (file_size - 64 - (32 * enc->frame_number)) / enc->block_align; /* PCM_S16BE_PLANAR */ + int64_t samples = (file_size - 64 - (32 * s->streams[0]->nb_frames)) / enc->block_align; /* PCM_S16BE_PLANAR */ av_log(s, AV_LOG_DEBUG, "total samples: %"PRId64"\n", samples); |