[FFmpeg-trac] #1834(swresample:reopened): swr_convert() results in integer division by zero exception
FFmpeg
trac at avcodec.org
Mon Jan 27 22:31:56 CET 2014
#1834: swr_convert() results in integer division by zero exception
------------------------------------+--------------------------------------
Reporter: mbradshaw | Owner: michael
Type: defect | Status: reopened
Priority: normal | Component: swresample
Version: git-master | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+--------------------------------------
Changes (by TheSHEEEP):
* status: closed => reopened
* resolution: invalid =>
Comment:
Hey.
I do have the same problem as the OP, but mine did not go away after
calling swr_init() as I did so from the beginning.
Here us how I initialize the context:
{{{
SwrContext* swrContext = swr_alloc_set_opts(NULL,
audioCodecContext->channel_layout, AV_SAMPLE_FMT_S16P,
audioCodecContext->sample_rate,
audioCodecContext->channel_layout,
audioCodecContext->sample_fmt, audioCodecContext->sample_rate,
0, NULL);
int result = swr_init(swrContext);
// Create destination sample buffer
uint8_t* destBuffer = NULL;
int destBufferLinesize;
av_samples_alloc( &destBuffer,
&destBufferLinesize,
videoInfo.audioNumChannels,
2048,
AV_SAMPLE_FMT_S16P,
0);
}}}
And here is the call to convert:
{{{
int outputSamples = swr_convert(p_swrContext,
&p_destBuffer, 2048,
(const uint8_t**)p_frame->extended_data,
p_frame->nb_samples);
}}}
I also tried using AV_SAMPLE_FMT_S16 (non-planaer, as that is what OpenAL
wants AFAIK), but it yields the same error.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/1834#comment:4>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list