mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavc: signal no output when a NULL frame is passed to audio encoder without delay
This commit is contained in:
parent
99cff417f3
commit
52953d61ca
@ -862,6 +862,8 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
|||||||
int user_packet = !!avpkt->data;
|
int user_packet = !!avpkt->data;
|
||||||
int nb_samples;
|
int nb_samples;
|
||||||
|
|
||||||
|
*got_packet_ptr = 0;
|
||||||
|
|
||||||
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
|
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
|
||||||
av_init_packet(avpkt);
|
av_init_packet(avpkt);
|
||||||
avpkt->size = 0;
|
avpkt->size = 0;
|
||||||
@ -883,7 +885,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->codec->encode2) {
|
if (avctx->codec->encode2) {
|
||||||
*got_packet_ptr = 0;
|
|
||||||
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
|
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
|
||||||
if (!ret && *got_packet_ptr) {
|
if (!ret && *got_packet_ptr) {
|
||||||
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
|
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user