diff options
author | Clément Bœsch <u@pkh.me> | 2016-06-21 22:40:56 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2016-06-21 22:40:56 +0200 |
commit | a4403e49b93a68f8c197615f346f2f891c35a4e5 (patch) | |
tree | f478c7f50367730937be83aec4c9ae8a9ba4432a /libavcodec | |
parent | 00e122bc0f2a4d867797f593770f9902f275b864 (diff) | |
parent | b7e64fba7f37cc0399beae844f0a5dbef9219376 (diff) | |
download | ffmpeg-a4403e49b93a68f8c197615f346f2f891c35a4e5.tar.gz |
Merge commit 'b7e64fba7f37cc0399beae844f0a5dbef9219376'
* commit 'b7e64fba7f37cc0399beae844f0a5dbef9219376':
Reduce the scope of some variables
Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dvbsubdec.c | 5 | ||||
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 4 | ||||
-rw-r--r-- | libavcodec/pgssubdec.c | 6 | ||||
-rw-r--r-- | libavcodec/xsubdec.c | 6 |
4 files changed, 14 insertions, 7 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index a4663d997f..e9f4765b15 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -827,7 +827,7 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou AVSubtitleRect *rect; DVBSubCLUT *clut; uint32_t *clut_table; - int i,j; + int i; int offset_x=0, offset_y=0; int ret = 0; @@ -924,10 +924,13 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou #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/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 2e12a3dddc..87d795478a 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -2931,7 +2931,7 @@ int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t s 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; @@ -3569,7 +3569,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 880fc96282..cef477d8c2 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -529,8 +529,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]) { @@ -597,11 +595,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 540607aa74..b024535df6 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; // check that at least header fits if (buf_size < 27 + 7 * 2 + 4 * (3 + has_alpha)) { @@ -134,11 +132,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 |