]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264.c
avcodec: Drop long-deprecated imgconvert.h header
[ffmpeg] / libavcodec / h264.c
index 2019de26bac371974ada3e89973a3be9f91bee6f..99cf5dc9f39b1db876fa214f54d662f94f6903e0 100644 (file)
@@ -2773,7 +2773,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
             }
         } else {
             /* Frame or first field in a potentially complementary pair */
-            assert(!s0->current_picture_ptr);
             s0->first_field = FIELD_PICTURE;
         }
 
@@ -3876,6 +3875,16 @@ again:
 
                 if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
                     h->cur_chroma_format_idc   != h->sps.chroma_format_idc) {
+                    if (s->avctx->codec &&
+                        s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU
+                        && (h->sps.bit_depth_luma != 8 ||
+                            h->sps.chroma_format_idc > 1)) {
+                        av_log(avctx, AV_LOG_ERROR,
+                               "VDPAU decoding does not support video "
+                               "colorspace\n");
+                        buf_index = -1;
+                        goto end;
+                    }
                     if (h->sps.bit_depth_luma >= 8 && h->sps.bit_depth_luma <= 10) {
                         avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
                         h->cur_chroma_format_idc   = h->sps.chroma_format_idc;