doc/examples/muxing: Remove unnecessary ret
Remove unnecessary ret and make the code more compact Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
parent
79508ee523
commit
3497362be1
@ -219,8 +219,6 @@ static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt,
|
|||||||
int sample_rate, int nb_samples)
|
int sample_rate, int nb_samples)
|
||||||
{
|
{
|
||||||
AVFrame *frame = av_frame_alloc();
|
AVFrame *frame = av_frame_alloc();
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!frame) {
|
if (!frame) {
|
||||||
fprintf(stderr, "Error allocating an audio frame\n");
|
fprintf(stderr, "Error allocating an audio frame\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -232,8 +230,7 @@ static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt,
|
|||||||
frame->nb_samples = nb_samples;
|
frame->nb_samples = nb_samples;
|
||||||
|
|
||||||
if (nb_samples) {
|
if (nb_samples) {
|
||||||
ret = av_frame_get_buffer(frame, 0);
|
if (av_frame_get_buffer(frame, 0) < 0) {
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr, "Error allocating an audio buffer\n");
|
fprintf(stderr, "Error allocating an audio buffer\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user