mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
Revert "swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size"
This reverts commit620b88a302. Fixes ticket #2272. Conflicts: libavformat/swfenc.c (cherry picked from commit8d0757e107)
This commit is contained in:
@@ -192,6 +192,10 @@ static int swf_write_header(AVFormatContext *s)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
if (enc->codec_id == AV_CODEC_ID_MP3) {
|
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_enc = enc;
|
||||||
swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
|
swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
|
||||||
if (!swf->audio_fifo)
|
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);
|
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 audio only stream make sure we add swf frames */
|
||||||
if (!swf->video_enc)
|
if (!swf->video_enc)
|
||||||
|
|||||||
Reference in New Issue
Block a user