1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Merge commit 'b7e64fba7f37cc0399beae844f0a5dbef9219376'

* commit 'b7e64fba7f37cc0399beae844f0a5dbef9219376':
  Reduce the scope of some variables

Merged-by: Clément Bœsch <u@pkh.me>
This commit is contained in:
Clément Bœsch 2016-06-21 22:40:56 +02:00
commit a4403e49b9
5 changed files with 15 additions and 8 deletions

View File

@ -827,7 +827,7 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
AVSubtitleRect *rect; AVSubtitleRect *rect;
DVBSubCLUT *clut; DVBSubCLUT *clut;
uint32_t *clut_table; uint32_t *clut_table;
int i,j; int i;
int offset_x=0, offset_y=0; int offset_x=0, offset_y=0;
int ret = 0; int ret = 0;
@ -924,10 +924,13 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
#if FF_API_AVPICTURE #if FF_API_AVPICTURE
FF_DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS
{
int j;
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
rect->pict.data[j] = rect->data[j]; rect->pict.data[j] = rect->data[j];
rect->pict.linesize[j] = rect->linesize[j]; rect->pict.linesize[j] = rect->linesize[j];
} }
}
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif

View File

@ -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){ static int encode_thread(AVCodecContext *c, void *arg){
MpegEncContext *s= *(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 chr_h= 16>>s->chroma_y_shift;
int i, j; int i, j;
MpegEncContext best_s = { 0 }, backup_s; MpegEncContext best_s = { 0 }, backup_s;
@ -3569,7 +3569,7 @@ FF_DISABLE_DEPRECATION_WARNINGS
/* Send the last GOB if RTP */ /* Send the last GOB if RTP */
if (s->avctx->rtp_callback) { if (s->avctx->rtp_callback) {
int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x; 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 */ /* Call the RTP callback to send the last GOB */
emms_c(); emms_c();
s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb); s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);

View File

@ -529,8 +529,6 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
} }
for (i = 0; i < ctx->presentation.object_count; i++) { for (i = 0; i < ctx->presentation.object_count; i++) {
PGSSubObject *object; PGSSubObject *object;
AVSubtitleRect *rect;
int j;
sub->rects[i] = av_mallocz(sizeof(*sub->rects[0])); sub->rects[i] = av_mallocz(sizeof(*sub->rects[0]));
if (!sub->rects[i]) { if (!sub->rects[i]) {
@ -597,11 +595,15 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
#if FF_API_AVPICTURE #if FF_API_AVPICTURE
FF_DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS
{
AVSubtitleRect *rect;
int j;
rect = sub->rects[i]; rect = sub->rects[i];
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
rect->pict.data[j] = rect->data[j]; rect->pict.data[j] = rect->data[j];
rect->pict.linesize[j] = rect->linesize[j]; rect->pict.linesize[j] = rect->linesize[j];
} }
}
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
} }

View File

@ -57,8 +57,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int64_t packet_time = 0; int64_t packet_time = 0;
GetBitContext gb; GetBitContext gb;
int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A'); int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A');
AVSubtitleRect *rect;
int j;
// check that at least header fits // check that at least header fits
if (buf_size < 27 + 7 * 2 + 4 * (3 + has_alpha)) { 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 #if FF_API_AVPICTURE
FF_DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS
{
AVSubtitleRect *rect;
int j;
rect = sub->rects[0]; rect = sub->rects[0];
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
rect->pict.data[j] = rect->data[j]; rect->pict.data[j] = rect->data[j];
rect->pict.linesize[j] = rect->linesize[j]; rect->pict.linesize[j] = rect->linesize[j];
} }
}
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif

View File

@ -971,9 +971,9 @@ fail:
static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt) static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt)
{ {
struct video_data *s = ctx->priv_data;
#if FF_API_CODED_FRAME #if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS
struct video_data *s = ctx->priv_data;
AVFrame *frame = ctx->streams[0]->codec->coded_frame; AVFrame *frame = ctx->streams[0]->codec->coded_frame;
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif