[FFmpeg-devel] Patch: CrystalHD decoder support

Vladimir Pantelic vladoman
Tue Dec 28 11:50:07 CET 2010


Philip Langdale wrote:

> * I still can only get avi/wmv containered content to sync correctly if
>    I force lavf from mplayer, as opposed to native demuxers - even with
>    -nocorrect-pts.

so you do not handle reordering?

> +static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
> +{
> +    BC_STATUS ret;
> +    BC_DTS_STATUS decoder_status;
> +    CHDContext *priv = avctx->priv_data;
> +    HANDLE dev = priv->dev;
> +    uint8_t input_full = 0;
> +    int len = avpkt->size;
> +    int rec_ret;
> +
> +    av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: decode_frame\n");
> +
> +    do {
> +        if (len) {
> +            int32_t tx_free = (int32_t)DtsTxFreeSize(dev);
> +            if (len<  tx_free - 1024) {
> +                uint64_t pts = avpkt->pts == AV_NOPTS_VALUE ? 0 : avpkt->pts;
> +                ret = DtsProcInput(dev, avpkt->data, len, pts, 0);

there is a pts going into the decoder, but where does it get back out? I guess
there is internal reordering for B frames, how is this handled?

your decoder should handle avctx->reordered_opaque





More information about the ffmpeg-devel mailing list