From b7e64fba7f37cc0399beae844f0a5dbef9219376 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 4 May 2016 00:15:41 +0200 Subject: Reduce the scope of some variables This avoids unused variable warnings after the next version bump. Also drop a trace level av_log() call that is in the way. --- libavcodec/dvbsubdec.c | 4 +++- libavcodec/dvdsubdec.c | 6 ++++-- libavcodec/mpegvideo_enc.c | 4 ++-- libavcodec/pgssubdec.c | 6 ++++-- libavcodec/xsubdec.c | 6 ++++-- 5 files changed, 17 insertions(+), 9 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index be68c58516..526f125262 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1350,7 +1350,6 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, i = 0; for (display = ctx->display_list; display; display = display->next) { - int j; region = get_region(ctx, display->region_id); rect = sub->rects[i]; @@ -1400,10 +1399,13 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, #if FF_API_AVPICTURE FF_DISABLE_DEPRECATION_WARNINGS +{ + int j; for (j = 0; j < 4; j++) { rect->pict.data[j] = rect->data[j]; rect->pict.linesize[j] = rect->linesize[j]; } +} FF_ENABLE_DEPRECATION_WARNINGS #endif diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index da1a83f812..6e55a09bc2 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -318,8 +318,6 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header, if (h < 0) h = 0; if (w > 0 && h > 0) { - int j; - AVSubtitleRect *rect; if (sub_header->rects) { for (i = 0; i < sub_header->num_rects; i++) { av_freep(&sub_header->rects[i]->data[0]); @@ -369,11 +367,15 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header, #if FF_API_AVPICTURE FF_DISABLE_DEPRECATION_WARNINGS +{ + int j; + AVSubtitleRect *rect; rect = sub_header->rects[0]; for (j = 0; j < 4; j++) { rect->pict.data[j] = rect->data[j]; rect->pict.linesize[j] = rect->linesize[j]; } +} FF_ENABLE_DEPRECATION_WARNINGS #endif } diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 17cdb87f2c..2667f3b543 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -2683,7 +2683,7 @@ static void update_mb_info(MpegEncContext *s, int startcode) static int encode_thread(AVCodecContext *c, void *arg){ MpegEncContext *s= *(void**)arg; - int mb_x, mb_y, pdif = 0; + int mb_x, mb_y; int chr_h= 16>>s->chroma_y_shift; int i, j; MpegEncContext best_s = { 0 }, backup_s; @@ -3307,7 +3307,7 @@ FF_DISABLE_DEPRECATION_WARNINGS /* Send the last GOB if RTP */ if (s->avctx->rtp_callback) { int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x; - pdif = put_bits_ptr(&s->pb) - s->ptr_lastgob; + int pdif = put_bits_ptr(&s->pb) - s->ptr_lastgob; /* Call the RTP callback to send the last GOB */ emms_c(); s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb); diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index a4cb66b0ae..886685b4b5 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -515,8 +515,6 @@ static int display_end_segment(AVCodecContext *avctx, void *data, } for (i = 0; i < ctx->presentation.object_count; i++) { PGSSubObject *object; - AVSubtitleRect *rect; - int j; sub->rects[i] = av_mallocz(sizeof(*sub->rects[0])); if (!sub->rects[i]) { @@ -580,11 +578,15 @@ static int display_end_segment(AVCodecContext *avctx, void *data, #if FF_API_AVPICTURE FF_DISABLE_DEPRECATION_WARNINGS +{ + AVSubtitleRect *rect; + int j; rect = sub->rects[i]; for (j = 0; j < 4; j++) { rect->pict.data[j] = rect->data[j]; rect->pict.linesize[j] = rect->linesize[j]; } +} FF_ENABLE_DEPRECATION_WARNINGS #endif diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 7e25787989..3af300c22b 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -57,8 +57,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, int64_t packet_time = 0; GetBitContext gb; int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A'); - AVSubtitleRect *rect; - int j; memset(sub, 0, sizeof(*sub)); @@ -135,11 +133,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, #if FF_API_AVPICTURE FF_DISABLE_DEPRECATION_WARNINGS +{ + AVSubtitleRect *rect; + int j; rect = sub->rects[0]; for (j = 0; j < 4; j++) { rect->pict.data[j] = rect->data[j]; rect->pict.linesize[j] = rect->linesize[j]; } +} FF_ENABLE_DEPRECATION_WARNINGS #endif -- cgit v1.2.3