[vlc-commits] avcodec: don't enqueue empty encoded block
Steve Lhomme
git at videolan.org
Thu Sep 7 13:00:04 CEST 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Aug 30 17:06:03 2017 +0200| [98e70d033eb5a55fe0070b4ca74896635920012f] | committer: Jean-Baptiste Kempf
avcodec: don't enqueue empty encoded block
There's no data, no timestamp and no flag to signal anything.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98e70d033eb5a55fe0070b4ca74896635920012f
---
modules/codec/avcodec/encoder.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 5e8e4f9425..9dff206b26 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1053,6 +1053,12 @@ static void vlc_av_packet_Release(block_t *block)
static block_t *vlc_av_packet_Wrap(AVPacket *packet, mtime_t i_length, AVCodecContext *context )
{
+ if ( packet->data == NULL &&
+ packet->flags == 0 &&
+ packet->pts == AV_NOPTS_VALUE &&
+ packet->dts == AV_NOPTS_VALUE )
+ return NULL; /* totally empty AVPacket */
+
vlc_av_packet_t *b = malloc( sizeof( *b ) );
if( unlikely(b == NULL) )
return NULL;
More information about the vlc-commits
mailing list