]> git.sesse.net Git - vlc/blobdiff - modules/codec/avcodec/video.c
Check "xlib" before trying vaapi.
[vlc] / modules / codec / avcodec / video.c
index ad71de551861451404798060f74b93bd4aafd956..d88fc26261c6552134535f5ea0d0c997126fc1ec 100644 (file)
@@ -451,10 +451,10 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
         p_sys->i_late_frames = 0;
 
-        block_Release( p_block );
+        if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
+            avcodec_flush_buffers( p_context );
 
-        //if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
-            //avcodec_flush_buffers( p_context );
+        block_Release( p_block );
         return NULL;
     }
 
@@ -559,6 +559,7 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
             p_context->reordered_opaque = (p_block->i_dts << 1) | 1;
         else
             p_context->reordered_opaque = INT64_MIN;
+        p_sys->p_ff_pic->reordered_opaque = p_context->reordered_opaque;
 
         /* Make sure we don't reuse the same timestamps twice */
         p_block->i_pts =
@@ -1172,6 +1173,11 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec,
         /* Only VLD supported */
         if( pi_fmt[i] == PIX_FMT_VAAPI_VLD )
         {
+            if( !var_InheritBool( p_dec, "xlib" ) )
+            {
+                msg_Warn( p_dec, "Ignoring VA API" );
+                continue;
+            }
 #ifdef HAVE_AVCODEC_VAAPI
             msg_Dbg( p_dec, "Trying VA API" );
             p_sys->p_va = vlc_va_NewVaapi( p_sys->i_codec_id );