diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-02-17 22:56:09 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-02-17 23:33:07 +0400 |
commit | 98d06b046dfec1a61cfd04906aff213b6fcce7e4 (patch) | |
tree | 79b6a7fb7fd6cdb4c2e0c703de53ed377a544538 | |
parent | 397e769f74dd4460db571e5126271214e8895d2a (diff) |
Revert "swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size"
This reverts commit 620b88a302d522f71a6a95aff500cf7bd8520043.
Fixes ticket #2272.
Conflicts:
libavformat/swfenc.c
(cherry picked from commit 8d0757e1079f588ed69f629e2d1a4d5f232dc298)
-rw-r--r-- | libavformat/swfenc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c index 4a5be12783..86618d3968 100644 --- a/libavformat/swfenc.c +++ b/libavformat/swfenc.c @@ -188,6 +188,10 @@ static int swf_write_header(AVFormatContext *s) AVCodecContext *enc = s->streams[i]->codec; if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { if (enc->codec_id == AV_CODEC_ID_MP3) { + if (!enc->frame_size) { + av_log(s, AV_LOG_ERROR, "audio frame size not set\n"); + return -1; + } swf->audio_enc = enc; swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE); if (!swf->audio_fifo) @@ -449,7 +453,7 @@ static int swf_write_audio(AVFormatContext *s, } av_fifo_generic_write(swf->audio_fifo, buf, size, NULL); - swf->sound_samples += av_get_audio_frame_duration(enc, size); + swf->sound_samples += enc->frame_size; /* if audio only stream make sure we add swf frames */ if (!swf->video_enc) |