]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/crystalhd.c
avcodec/h264: use some 3 operand forms
[ffmpeg] / libavcodec / crystalhd.c
index 8956ca4bfb6c485fe86fe681b85a294c429c0f5e..83bc8bf36410715c43c25f1c5f673f8b62a4d12c 100644 (file)
@@ -101,7 +101,6 @@ typedef struct {
 
     /* Options */
     uint32_t sWidth;
-    uint8_t bframe_bug;
 } CHDContext;
 
 static const AVOption options[] = {
@@ -537,14 +536,13 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
     if (interlaced)
         frame->top_field_first = !bottom_first;
 
-    if (pkt_pts != AV_NOPTS_VALUE) {
-        frame->pts = pkt_pts;
+    frame->pts = pkt_pts;
 #if FF_API_PKT_PTS
 FF_DISABLE_DEPRECATION_WARNINGS
-        frame->pkt_pts = pkt_pts;
+    frame->pkt_pts = pkt_pts;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
-    }
+
     frame->pkt_pos = -1;
     frame->pkt_duration = 0;
     frame->pkt_size = -1;
@@ -632,16 +630,6 @@ static inline CopyRet receive_frame(AVCodecContext *avctx,
     } else if (ret == BC_STS_SUCCESS) {
         int copy_ret = -1;
         if (output.PoutFlags & BC_POUT_FLAGS_PIB_VALID) {
-            if (avctx->codec->id == AV_CODEC_ID_MPEG4 &&
-                output.PicInfo.timeStamp == 0 && priv->bframe_bug) {
-                if (!priv->bframe_bug) {
-                    av_log(avctx, AV_LOG_VERBOSE,
-                           "CrystalHD: Not returning packed frame twice.\n");
-                }
-                DtsReleaseOutputBuffs(dev, NULL, FALSE);
-                return RET_COPY_AGAIN;
-            }
-
             print_frame_info(priv, &output);
 
             copy_ret = copy_frame(avctx, &output, frame, got_frame);
@@ -676,21 +664,6 @@ static int crystalhd_decode_packet(AVCodecContext *avctx, const AVPacket *avpkt)
 
     if (avpkt && avpkt->size) {
         uint64_t pts;
-        if (!priv->bframe_bug && (avpkt->size == 6 || avpkt->size == 7)) {
-            /*
-             * Drop frames trigger the bug
-             */
-            av_log(avctx, AV_LOG_WARNING,
-                   "CrystalHD: Enabling work-around for packed b-frame bug\n");
-            priv->bframe_bug = 1;
-        } else if (priv->bframe_bug && avpkt->size == 8) {
-            /*
-             * Delay frames don't trigger the bug
-             */
-            av_log(avctx, AV_LOG_WARNING,
-                   "CrystalHD: Disabling work-around for packed b-frame bug\n");
-            priv->bframe_bug = 0;
-        }
 
         /*
          * Despite being notionally opaque, either libcrystalhd or
@@ -826,7 +799,7 @@ DEFINE_CRYSTALHD_DECODER(mpeg2, MPEG2VIDEO, NULL)
 #endif
 
 #if CONFIG_MPEG4_CRYSTALHD_DECODER
-DEFINE_CRYSTALHD_DECODER(mpeg4, MPEG4, NULL)
+DEFINE_CRYSTALHD_DECODER(mpeg4, MPEG4, "mpeg4_unpack_bframes")
 #endif
 
 #if CONFIG_MSMPEG4_CRYSTALHD_DECODER