[MPlayer-dev-eng] [PATCH] demuxers cleanup (was Re: [PATCH] misc small fixes (mostly gcc warnings) )

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Sun Nov 13 23:38:42 CET 2005


On Sunday, 13 November 2005 at 20:07, Roberto Togni wrote:
>
> There was both seek functions returning int and seek functions
> returning void before the demuxer patch, but in every case the return
> value was ignored. Probably i forgot to change these to void. If we
> prefer to change them all to int we can talk about it, but if we don't
> do anything with the result i see no reason to do it.

The return values are indeed ignored everywhere. Here's a patch that
makes all the remaining non-void demuxer seek/close functions void.
Apply it or decide on the return value semantics. ;)

R.

-- 
MPlayer RPMs maintainer: http://rpm.greysector.net/mplayer/
"I am Grey. I stand between the candle and the star. We are Grey.
 We stand between the darkness ... and the light."
        -- Delenn in Grey Council in Babylon 5:"Babylon Squared"
-------------- next part --------------
--- MPlayer-20051109/libmpdemux/tv.c.demux	2005-09-22 16:20:49.000000000 +0200
+++ MPlayer-20051109/libmpdemux/tv.c	2005-11-12 20:35:30.000000000 +0100
@@ -603,10 +603,10 @@
     return demuxer;
 }
 
-static int demux_close_tv(demuxer_t *demuxer)
+static void demux_close_tv(demuxer_t *demuxer)
 {
     tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv);
-    return(tvh->functions->uninit(tvh->priv));
+    tvh->functions->uninit(tvh->priv);
 }
 
 /* ================== STREAM_TV ===================== */
--- MPlayer-20051109/libmpdemux/demux_ty.c.demux	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/demux_ty.c	2005-11-12 22:42:38.000000000 +0100
@@ -1360,7 +1360,7 @@
 }
 
 
-static int demux_close_ty( demuxer_t *demux )
+static void demux_close_ty( demuxer_t *demux )
 {
    TiVoInfo         *tivo = 0;
 
@@ -1371,7 +1371,6 @@
       demux->a_streams[ MAX_A_STREAMS - 1 ] = 0;
 	   sub_justify = 0;
    }
-   return( 0 );
 }
 
 
--- MPlayer-20051109/libmpdemux/demux_real.c.demux	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/demux_real.c	2005-11-12 20:35:30.000000000 +0100
@@ -1749,7 +1749,7 @@
 }
 
 /* please upload RV10 samples WITH INDEX CHUNK */
-static int demux_seek_real(demuxer_t *demuxer, float rel_seek_secs, int flags)
+static void demux_seek_real(demuxer_t *demuxer, float rel_seek_secs, int flags)
 {
     real_priv_t *priv = demuxer->priv;
     demux_stream_t *d_audio = demuxer->audio;
@@ -1771,7 +1771,7 @@
 //    printf("streams: %d\n", streams);
 
     if (!streams)
-	return 0;
+	return;
 
     if (flags & 1)
 	/* seek absolute */
@@ -1838,7 +1838,6 @@
         stream_seek(demuxer->stream, next_offset);
 
     demux_real_fill_buffer(demuxer, NULL);
-    return 1;
 }
 
 static int demux_real_control(demuxer_t *demuxer, int cmd, void *arg)
--- MPlayer-20051109/libmpdemux/demux_pva.c.demux	2005-08-06 02:41:23.000000000 +0200
+++ MPlayer-20051109/libmpdemux/demux_pva.c	2005-11-12 20:35:30.000000000 +0100
@@ -466,7 +466,7 @@
 	return 1;
 }
 
-static int demux_seek_pva(demuxer_t * demuxer,float rel_seek_secs,int flags)
+static void demux_seek_pva(demuxer_t * demuxer,float rel_seek_secs,int flags)
 {
 	int total_bitrate=0;
 	off_t dest_offset;
@@ -490,7 +490,7 @@
 	if(!pva_sync(demuxer))
 	{
 		mp_msg(MSGT_DEMUX,MSGL_V,"demux_pva: Couldn't seek!\n");
-		return 0;
+		return;
 	}
 	
 	/*
@@ -501,8 +501,6 @@
 	
 	priv->last_video_pts=-1;
 	priv->last_audio_pts=-1;
-	
-	return 1;
 }
 
 


More information about the MPlayer-dev-eng mailing list