[vlc-devel] ffmpeg encoder bugfix: almost fed libavcodec with a frame in the past

Robert Stepanek rost at lo-res.org
Wed Jan 10 21:17:12 CET 2007


Hi,

when using the current SVN version (Revision: 18544) and transcoding  
a stream using the ffmpeg encoder plugin I get the following error  
messages: "ffmpeg encoder warning: almost fed libavcodec with a frame  
in the past (current: -9223372036854775808, last: 0)" and no video  
frames at all.

This is due to a cast in modules/codec/ffmpeg/encoder.c in line 805  
between the frame's pts and ffmpeg's AV_NOPTS_VALUE.

Here is a patch which fixes the bug by doing the cast the other way  
round (casting frame.pts to an unsigned int versus casting  
AV_NOPTS_VALUE to a signed int ).

Hope it helps (it did for me ;) )

Please tell me if patches are not welcome on this list (e.g. use trac  
for this?).

regards,
Robert

<PATCH BEGIN>
--- vlc-trunk-vanilla/modules/codec/ffmpeg/encoder.c    2007-01-10  
20:50:15.000000000 +0100
+++ vlc-trunk/modules/codec/ffmpeg/encoder.c    2007-01-10  
21:01:37.000000000 +0100
@@ -802,7 +802,7 @@
          frame.pts = AV_NOPTS_VALUE;
      }
-    if ( frame.pts != (signed int) AV_NOPTS_VALUE && frame.pts != 0 )
+    if ( (uint64_t)frame.pts != AV_NOPTS_VALUE && frame.pts != 0 )
      {
          if ( p_sys->i_last_pts == frame.pts )
          {
<PATCH END>

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list