Browse Source

lavc/mediacodecdec{,_h264}: set FF_CODEC_CAP_SETS_PKT_DTS capability

And sets frames pkt_dts to AV_NOPTS_VALUE as we do not want lavc/utils
to overwrite the field with incorrect values as the decoder is
asynchronous.
tags/n3.1
Matthieu Bouron 9 years ago
parent
commit
432891a96e
2 changed files with 2 additions and 0 deletions
  1. +1
    -0
      libavcodec/mediacodecdec.c
  2. +1
    -0
      libavcodec/mediacodecdec_h264.c

+ 1
- 0
libavcodec/mediacodecdec.c View File

@@ -162,6 +162,7 @@ static int mediacodec_wrap_buffer(AVCodecContext *avctx,
* * N avpackets can be pushed before 1 frame is actually returned * * N avpackets can be pushed before 1 frame is actually returned
* * 0-sized avpackets are pushed to flush remaining frames at EOS */ * * 0-sized avpackets are pushed to flush remaining frames at EOS */
frame->pkt_pts = info->presentationTimeUs; frame->pkt_pts = info->presentationTimeUs;
frame->pkt_dts = AV_NOPTS_VALUE;


av_log(avctx, AV_LOG_DEBUG, av_log(avctx, AV_LOG_DEBUG,
"Frame: width=%d stride=%d height=%d slice-height=%d " "Frame: width=%d stride=%d height=%d slice-height=%d "


+ 1
- 0
libavcodec/mediacodecdec_h264.c View File

@@ -344,4 +344,5 @@ AVCodec ff_h264_mediacodec_decoder = {
.flush = mediacodec_decode_flush, .flush = mediacodec_decode_flush,
.close = mediacodec_decode_close, .close = mediacodec_decode_close,
.capabilities = CODEC_CAP_DELAY, .capabilities = CODEC_CAP_DELAY,
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
}; };

Loading…
Cancel
Save