fixed YUV4MPEG frame reader

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3791 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2001-12-27 11:39:47 +00:00
parent 46fb559fd7
commit 9ceaa48f02
1 changed files with 11 additions and 1 deletions

View File

@ -81,7 +81,17 @@ int demux_y4m_fill_buffer(demuxer_t *demux) {
if (priv->is_older)
{
stream_skip(demux->stream, 6); /* FRAME\n */
int c;
c = stream_read_char(demux->stream); /* F */
if (c == -256)
return 0; /* EOF */
if (c != 'F')
{
printf("Bad frame at %p\n", stream_tell(demux->stream)-1);
return 0;
}
stream_skip(demux->stream, 5); /* RAME\n */
stream_read(demux->stream, buf[0], size);
stream_read(demux->stream, buf[1], size/4);
stream_read(demux->stream, buf[2], size/4);