aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-02-17 19:56:09 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-02-17 20:27:19 +0100
commit6407800521d26b103db4c22d9de709e957381e4b (patch)
tree30bacbe776226aadaf012c3bcb34bd40bcb92bdf
parent057051b84879feff7aafa9669e1cb3266a6bb589 (diff)
downloadffmpeg-6407800521d26b103db4c22d9de709e957381e4b.tar.gz
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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index a8fd9f91f0..5b7fd1fe5c 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -192,6 +192,10 @@ static int swf_write_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
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)
@@ -457,7 +461,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)