[MPlayer-cvslog] r35384 - trunk/libmpdemux/demux_y4m.c

reimar subversion at mplayerhq.hu
Sat Nov 10 13:27:26 CET 2012


Author: reimar
Date: Sat Nov 10 13:27:26 2012
New Revision: 35384

Log:
Minor simplifications.

Modified:
   trunk/libmpdemux/demux_y4m.c

Modified: trunk/libmpdemux/demux_y4m.c
==============================================================================
--- trunk/libmpdemux/demux_y4m.c	Sat Nov 10 13:20:36 2012	(r35383)
+++ trunk/libmpdemux/demux_y4m.c	Sat Nov 10 13:27:26 2012	(r35384)
@@ -87,7 +87,7 @@ static int demux_y4m_fill_buffer(demuxer
   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 @@ static int demux_y4m_fill_buffer(demuxer
 
   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 @@ static int demux_y4m_fill_buffer(demuxer
   }
   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 @@ static void read_streaminfo(demuxer_t *d
 
 	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 @@ static void demux_close_y4m(demuxer_t *d
     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;
 }
 


More information about the MPlayer-cvslog mailing list