From patchwork Fri Feb 1 22:33:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 11948 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 34400445B22 for ; Sat, 2 Feb 2019 00:34:48 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2085368A7CF; Sat, 2 Feb 2019 00:34:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-2.mx.upcmail.net (vie01a-dmta-pe05-2.mx.upcmail.net [84.116.36.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4070A68A6BE for ; Sat, 2 Feb 2019 00:34:42 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1gphOU-0003Jx-0P for ffmpeg-devel@ffmpeg.org; Fri, 01 Feb 2019 23:34:42 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id phNUgAjxw2WSsphNUg0sGh; Fri, 01 Feb 2019 23:33:40 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=E7kcWpVl c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=pINhZ37JdqdLeaE-45YA:9 a=L_4qnVSFCVNiNvx8:21 a=B2SbrE-swkyzNxG7:21 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 1 Feb 2019 23:33:35 +0100 Message-Id: <20190201223335.720-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201223335.720-1-michael@niedermayer.cc> References: <20190201223335.720-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfE8X2qD9a7t8LlPANl340lR+DZl1wvP4sz+pIskgFYqdWkSTe7vd9JOdUXX0N2lvYbj/YjaEO9+QGLRJJ/HBkWZe/O8Tzdo7qWhunOQq9u2XZiOyokpH qzSsThCZZrX5Mit4TTHbOYefWa4ByC4xWHGZ71WgQzF0gXtuSIIktaKK Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/mpegvideo_enc: Use av_assert1() instead of assert() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo_enc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index c5480e17c4..4fa628b741 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1948,7 +1948,7 @@ FF_ENABLE_DEPRECATION_WARNINGS s->pict_type); if (s->avctx->flags & AV_CODEC_FLAG_PASS1) - assert(put_bits_count(&s->pb) == s->header_bits + s->mv_bits + + av_assert1(put_bits_count(&s->pb) == s->header_bits + s->mv_bits + s->misc_bits + s->i_tex_bits + s->p_tex_bits); flush_put_bits(&s->pb); @@ -2005,7 +2005,7 @@ FF_ENABLE_DEPRECATION_WARNINGS av_log(s->avctx, AV_LOG_ERROR, "Internal error, negative bits\n"); - assert(s->repeat_first_field == 0); + av_assert1(s->repeat_first_field == 0); vbv_delay = bits * 90000 / s->avctx->rc_max_rate; min_delay = (minbits * 90000LL + s->avctx->rc_max_rate - 1) / @@ -3056,7 +3056,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ if(r % d == 0){ current_packet_size=0; s->pb.buf_ptr= s->ptr_lastgob; - assert(put_bits_ptr(&s->pb) == s->ptr_lastgob); + av_assert1(put_bits_ptr(&s->pb) == s->ptr_lastgob); } } @@ -3642,11 +3642,11 @@ static void set_frame_distances(MpegEncContext * s){ if(s->pict_type==AV_PICTURE_TYPE_B){ s->pb_time= s->pp_time - (s->last_non_b_time - s->time); - assert(s->pb_time > 0 && s->pb_time < s->pp_time); + av_assert1(s->pb_time > 0 && s->pb_time < s->pp_time); }else{ s->pp_time= s->time - s->last_non_b_time; s->last_non_b_time= s->time; - assert(s->picture_number==0 || s->pp_time > 0); + av_assert1(s->picture_number==0 || s->pp_time > 0); } }