1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

dv: Mark internal frame reference as const

Silence a warning due to frame assignment in dvenc. All uses of the
reference in dvdec are read only, except the ones in the main decoding
function, so use the frame pointer directly there.
This commit is contained in:
Vittorio Giovara
2015-10-02 12:43:39 +02:00
parent 4c160fa239
commit cab63a8b59
2 changed files with 8 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ typedef struct DVwork_chunk {
typedef struct DVVideoContext { typedef struct DVVideoContext {
const AVDVProfile *sys; const AVDVProfile *sys;
AVFrame *frame; const AVFrame *frame;
AVCodecContext *avctx; AVCodecContext *avctx;
uint8_t *buf; uint8_t *buf;

View File

@@ -350,6 +350,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data,
uint8_t *buf = avpkt->data; uint8_t *buf = avpkt->data;
int buf_size = avpkt->size; int buf_size = avpkt->size;
DVVideoContext *s = avctx->priv_data; DVVideoContext *s = avctx->priv_data;
AVFrame *frame = data;
const uint8_t *vsc_pack; const uint8_t *vsc_pack;
int apt, is16_9, ret; int apt, is16_9, ret;
const AVDVProfile *sys; const AVDVProfile *sys;
@@ -369,9 +370,9 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data,
s->sys = sys; s->sys = sys;
} }
s->frame = data; s->frame = frame;
s->frame->key_frame = 1; frame->key_frame = 1;
s->frame->pict_type = AV_PICTURE_TYPE_I; frame->pict_type = AV_PICTURE_TYPE_I;
avctx->pix_fmt = s->sys->pix_fmt; avctx->pix_fmt = s->sys->pix_fmt;
avctx->framerate = av_inv_q(s->sys->time_base); avctx->framerate = av_inv_q(s->sys->time_base);
@@ -388,12 +389,12 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data,
ff_set_sar(avctx, s->sys->sar[is16_9]); ff_set_sar(avctx, s->sys->sar[is16_9]);
} }
if (ff_get_buffer(avctx, s->frame, 0) < 0) { if (ff_get_buffer(avctx, frame, 0) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1; return -1;
} }
s->frame->interlaced_frame = 1; frame->interlaced_frame = 1;
s->frame->top_field_first = 0; frame->top_field_first = 0;
s->buf = buf; s->buf = buf;
avctx->execute(avctx, dv_decode_video_segment, s->work_chunks, NULL, avctx->execute(avctx, dv_decode_video_segment, s->work_chunks, NULL,