You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/mlpenc: stop returning packets with no data
This commit is contained in:
@@ -1178,7 +1178,7 @@ static void write_frame_headers(MLPEncodeContext *ctx, uint8_t *frame_header,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Writes an entire access unit to the bitstream. */
|
/** Writes an entire access unit to the bitstream. */
|
||||||
static unsigned int write_access_unit(MLPEncodeContext *ctx, uint8_t *buf,
|
static int write_access_unit(MLPEncodeContext *ctx, uint8_t *buf,
|
||||||
int buf_size, int restart_frame)
|
int buf_size, int restart_frame)
|
||||||
{
|
{
|
||||||
uint16_t substream_data_len[MAX_SUBSTREAMS];
|
uint16_t substream_data_len[MAX_SUBSTREAMS];
|
||||||
@@ -2183,7 +2183,7 @@ static int mlp_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
const AVFrame *frame, int *got_packet)
|
const AVFrame *frame, int *got_packet)
|
||||||
{
|
{
|
||||||
MLPEncodeContext *ctx = avctx->priv_data;
|
MLPEncodeContext *ctx = avctx->priv_data;
|
||||||
unsigned int bytes_written = 0;
|
int bytes_written = 0;
|
||||||
int restart_frame, ret;
|
int restart_frame, ret;
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
|
|
||||||
@@ -2316,8 +2316,14 @@ no_data_left:
|
|||||||
}
|
}
|
||||||
if (!frame)
|
if (!frame)
|
||||||
avctx->frame_number++;
|
avctx->frame_number++;
|
||||||
|
|
||||||
|
if (bytes_written > 0) {
|
||||||
avpkt->size = bytes_written;
|
avpkt->size = bytes_written;
|
||||||
*got_packet = 1;
|
*got_packet = 1;
|
||||||
|
} else {
|
||||||
|
*got_packet = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user