]> git.sesse.net Git - vlc/blobdiff - modules/codec/ffmpeg/video.c
Make PIX_FMT_RGBA dependend on ffmpeg with swscale. Patch by Remi Duraffort <ivoire...
[vlc] / modules / codec / ffmpeg / video.c
index 48f37410d7b3dbd27103d5c74027697f7fd42c4e..0672e2d38c974f036d3843cbbbdd9b952352cf0d 100644 (file)
@@ -126,6 +126,10 @@ static uint32_t ffmpeg_PixFmtToChroma( int i_ff_chroma )
         return VLC_FOURCC('R','V','2','4');
     case PIX_FMT_RGBA32:
         return VLC_FOURCC('R','V','3','2');
+#if defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
+    case PIX_FMT_RGBA:
+        return VLC_FOURCC('R','G','B','A');
+#endif
     case PIX_FMT_GRAY8:
         return VLC_FOURCC('G','R','E','Y');
 
@@ -378,7 +382,7 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
         p_sys->p_context->palctrl = &palette_control;
 
     /* ***** Open the codec ***** */
-    vlc_mutex_t *lock = var_GetAcquireMutex( "avcodec" );
+    vlc_mutex_t *lock = var_AcquireMutex( "avcodec" );
     if( lock == NULL )
     {
         free( p_sys );
@@ -470,7 +474,9 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
         b_drawpicture = 0;
         if( p_sys->i_late_frames < 8 )
         {
-            p_sys->p_context->skip_frame = AVDISCARD_NONKEY;
+            p_sys->p_context->skip_frame =
+                    (p_sys->i_skip_frame <= AVDISCARD_BIDIR) ?
+                    AVDISCARD_BIDIR : p_sys->i_skip_frame;
         }
         else
         {
@@ -573,7 +579,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
         }
 
         /* Update frame late count (except when doing preroll) */
-        if( p_sys->i_pts && p_sys->i_pts <= mdate() &&
+        if( p_sys->i_pts && decoder_GetDisplayDate(p_dec, p_sys->i_pts) <= mdate() &&
             !(p_block->i_flags & BLOCK_FLAG_PREROLL) )
         {
             p_sys->i_late_frames++;