[vlc-devel] Re: Fixes for HDTV grey line bug

Marian Durkovic md at bts.sk
Mon Oct 17 15:13:35 CEST 2005


On Mon, Oct 17, 2005 at 02:00:42PM +0200, Derk-Jan Hartman wrote:
> Perhaps you could best put a sample of such a stream online  
> somewhere, so we can test the patch on all video output modules?

You can use an example stream from e.g.

http://www.heuris.com/teststreams/web/emotion.m2t

After changeset 10160 is reapplied, non-compliant video output will 
certainly segfault, since the libmpeg2 will try to write outside of direct 
render buffer space.


	With kind regards,

		M.

> 
> DJ
> 
> On 15 okt 2005, at 11:10, Marian Durkovic wrote:
> 
> >Hi all,
> >
> >  in an attempt to fix the annoying HDTV grey line bug (caused by  
> >displaying
> >1088 lines instead of only 1080 real lines) I've found the following
> >changesets:
> >
> >https://trac.videolan.org/vlc/changeset/10160
> >https://trac.videolan.org/vlc/changeset/10161
> >
> >  Looking at the video output modules, seems only the ones which  
> >deliver
> >more than 1 direct buffer are affected (namely xvideo and sdl, are  
> >there
> >others?). The modules which deliver only 1 direct buffer (e.g.  
> >directx)
> >and go through memcpy work fine, also indirect rendering works of  
> >course.
> >
> >  For the mentioned ones, the fixes seem to be quite simple:
> >
> >xvideo:
> >-------
> >
> >make sure that the buffer width/height is aligned to a multiple of 16,
> >xvideo handles cropping automatically.
> >
> >The following code solves the problem, it needs to be put into
> >modules/video_output/x11/xcommon.c, functions CreateShmImage() and
> >CreateImage() - just under #ifdef MODULE_NAME_IS_xvideo
> >
> >    /* Make sure the buffer is aligned to multiple of 16 */
> >    i_height = ( i_height + 15 ) >> 4 << 4;
> >    i_width = ( i_width + 15 ) >> 4 << 4;
> >
> >sdl:
> >----
> >
> >unfortunately sdl doesn't seem to be able of cropping the buffer,  
> >so the
> >only solution seems to be reducing number of direct buffers to 1 in
> >modules/video_output/sdl.c:
> >
> >#define SDL_MAX_DIRECTBUFFERS 1
> >
> >With the above changes, changeset 10160 could be reapplied, but it  
> >needs
> >to be enhanced with the following check, since some broadcasters  
> >ignore
> >the MPEG2 spec:
> >
> >    if( i_height == 1088 )
> >    {
> >        i_height = 1080;
> >        msg_Warn( p_vout, "Incorrect HDTV stream - reducing height  
> >to 1080");
> >    }
> >
> >
> >    With kind regards,
> >

-- 
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