diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-12-05 18:24:43 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-12-05 18:24:43 +0000 |
commit | 4012cd6c4f19f09cac86c9b8c9738f27bb691764 (patch) | |
tree | 605a9342eb74f30c32ce1a772880612e7066d930 /libavcodec/crystalhd.c | |
parent | 835fd779a46d14d6999618546a9833b3f2af2326 (diff) | |
download | ffmpeg-4012cd6c4f19f09cac86c9b8c9738f27bb691764.tar.gz |
lavc: fix decode_frame() third parameter semantics for rest of video decoders
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/crystalhd.c')
-rw-r--r-- | libavcodec/crystalhd.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index d18243c128..95f1fb6e8d 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -536,7 +536,7 @@ static av_cold int init(AVCodecContext *avctx) static inline CopyRet copy_frame(AVCodecContext *avctx, BC_DTS_PROC_OUT *output, - void *data, int *data_size) + void *data, int *got_frame) { BC_STATUS ret; BC_DTS_STATUS decoder_status = { 0, }; @@ -696,7 +696,7 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, priv->pic.pkt_pts = pkt_pts; if (!priv->need_second_field) { - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = priv->pic; } @@ -733,7 +733,7 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, static inline CopyRet receive_frame(AVCodecContext *avctx, - void *data, int *data_size) + void *data, int *got_frame) { BC_STATUS ret; BC_DTS_PROC_OUT output = { @@ -743,7 +743,7 @@ static inline CopyRet receive_frame(AVCodecContext *avctx, CHDContext *priv = avctx->priv_data; HANDLE dev = priv->dev; - *data_size = 0; + *got_frame = 0; // Request decoded data from the driver ret = DtsProcOutputNoCopy(dev, OUTPUT_PROC_TIMEOUT, &output); @@ -840,8 +840,8 @@ static inline CopyRet receive_frame(AVCodecContext *avctx, priv->last_picture = output.PicInfo.picture_number - 1; } - copy_ret = copy_frame(avctx, &output, data, data_size); - if (*data_size > 0) { + copy_ret = copy_frame(avctx, &output, data, got_frame); + if (*got_frame > 0) { avctx->has_b_frames--; priv->last_picture++; av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: Pipeline length: %u\n", @@ -868,7 +868,7 @@ static inline CopyRet receive_frame(AVCodecContext *avctx, } -static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { BC_STATUS ret; BC_DTS_STATUS decoder_status = { 0, }; @@ -1026,8 +1026,8 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a } do { - rec_ret = receive_frame(avctx, data, data_size); - if (rec_ret == RET_OK && *data_size == 0) { + rec_ret = receive_frame(avctx, data, got_frame); + if (rec_ret == RET_OK && *got_frame == 0) { /* * This case is for when the encoded fields are stored * separately and we get a separate avpkt for each one. To keep @@ -1052,8 +1052,8 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a ret = DtsGetDriverStatus(dev, &decoder_status); if (ret == BC_STS_SUCCESS && decoder_status.ReadyListCount > 0) { - rec_ret = receive_frame(avctx, data, data_size); - if ((rec_ret == RET_OK && *data_size > 0) || + rec_ret = receive_frame(avctx, data, got_frame); + if ((rec_ret == RET_OK && *got_frame > 0) || rec_ret == RET_ERROR) break; } |