# HG changeset patch # User reimar # Date 1352550446 0 # Node ID 17a449bc5106e626a8ebc00b6e99e29505a6de7e # Parent 3ae6e6d9186f20680c393286342c9e102b1e287b Minor simplifications. diff -r 3ae6e6d9186f -r 17a449bc5106 libmpdemux/demux_y4m.c --- a/libmpdemux/demux_y4m.c Sat Nov 10 12:20:36 2012 +0000 +++ b/libmpdemux/demux_y4m.c Sat Nov 10 12:27:26 2012 +0000 @@ -87,7 +87,7 @@ y4m_priv_t *priv=demux->priv; y4m_frame_info_t fi; unsigned char *buf[3]; - int err, size; + int size; int nextc; nextc = stream_read_char(demux->stream); @@ -112,9 +112,7 @@ if (priv->is_older) { - int c; - - c = stream_read_char(demux->stream); /* F */ + int c = stream_read_char(demux->stream); /* F */ if (c == -256) return 0; /* EOF */ if (c != 'F') @@ -129,7 +127,8 @@ } else { - if ((err=y4m_read_frame(demux->stream, priv->si, &fi, buf)) != Y4M_OK) { + int err = y4m_read_frame(demux->stream, priv->si, &fi, buf); + if (err != Y4M_OK) { mp_msg(MSGT_DEMUX, MSGL_ERR, "error reading frame %s\n", y4m_strerr(err)); return 0; } @@ -159,15 +158,15 @@ stream_skip(demuxer->stream, 8); /* YUV4MPEG */ stream_skip(demuxer->stream, 1); /* space */ - stream_read(demuxer->stream, (char *)&buf[0], 3); + stream_read(demuxer->stream, buf, 3); buf[3] = 0; sh->disp_w = atoi(buf); stream_skip(demuxer->stream, 1); /* space */ - stream_read(demuxer->stream, (char *)&buf[0], 3); + stream_read(demuxer->stream, buf, 3); buf[3] = 0; sh->disp_h = atoi(buf); stream_skip(demuxer->stream, 1); /* space */ - stream_read(demuxer->stream, (char *)&buf[0], 1); + stream_read(demuxer->stream, buf, 1); buf[1] = 0; frame_rate_code = atoi(buf); stream_skip(demuxer->stream, 1); /* new-line */ @@ -300,9 +299,9 @@ if(!priv) return; if (!priv->is_older) - y4m_fini_stream_info(((y4m_priv_t*)demuxer->priv)->si); - free(((y4m_priv_t*)demuxer->priv)->si); - free(demuxer->priv); + y4m_fini_stream_info(priv->si); + free(priv->si); + free(priv); return; }