[MPlayer-cvslog] r29962 - in trunk: libmpdemux/demux_audio.c libmpdemux/demux_avi.c libmpdemux/demux_lavf.c libmpdemux/muxer_lavf.c stream/http.c stream/stream.c stream/stream.h stream/stream_cue.c stream/stream_dv...

reimar subversion at mplayerhq.hu
Sun Nov 22 16:18:22 CET 2009


Author: reimar
Date: Sun Nov 22 16:18:21 2009
New Revision: 29962

Log:
Finally rename the STREAM_SEEK define to MP_STREAM_SEEK, there are just too many
name clashes, in particular with Windows headers (which define STREAM_SEEK as an enum type).

Modified:
   trunk/libmpdemux/demux_audio.c
   trunk/libmpdemux/demux_avi.c
   trunk/libmpdemux/demux_lavf.c
   trunk/libmpdemux/muxer_lavf.c
   trunk/stream/http.c
   trunk/stream/stream.c
   trunk/stream/stream.h
   trunk/stream/stream_cue.c
   trunk/stream/stream_dvd.c
   trunk/stream/stream_dvdnav.c
   trunk/stream/stream_file.c
   trunk/stream/stream_netstream.c
   trunk/stream/stream_smb.c
   trunk/subreader.c

Modified: trunk/libmpdemux/demux_audio.c
==============================================================================
--- trunk/libmpdemux/demux_audio.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/libmpdemux/demux_audio.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -346,7 +346,7 @@ static int demux_audio_open(demuxer_t* d
     sh_audio->i_bps = sh_audio->wf->nAvgBytesPerSec;
     free(mp3_found);
     mp3_found = NULL;
-    if(s->end_pos && (s->flags & STREAM_SEEK) == STREAM_SEEK) {
+    if(s->end_pos && (s->flags & MP_STREAM_SEEK) == MP_STREAM_SEEK) {
       char tag[4];
       stream_seek(s,s->end_pos-128);
       stream_read(s,tag,3);

Modified: trunk/libmpdemux/demux_avi.c
==============================================================================
--- trunk/libmpdemux/demux_avi.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/libmpdemux/demux_avi.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -237,7 +237,7 @@ do{
     }
 
     pos = (off_t)priv->idx_offset+AVI_IDX_OFFSET(idx);
-    if((pos<demux->movi_start || pos>=demux->movi_end) && (demux->movi_end>demux->movi_start) && (demux->stream->flags & STREAM_SEEK)){
+    if((pos<demux->movi_start || pos>=demux->movi_end) && (demux->movi_end>demux->movi_start) && (demux->stream->flags & MP_STREAM_SEEK)){
       mp_msg(MSGT_DEMUX,MSGL_V,"ChunkOffset out of range!   idx=0x%"PRIX64"  \n",(int64_t)pos);
       continue;
     }
@@ -262,7 +262,7 @@ do{
     if(!(idx->dwFlags&AVIIF_KEYFRAME)) flags=0;
   } else {
     demux->filepos=stream_tell(demux->stream);
-    if(demux->filepos>=demux->movi_end && demux->movi_end>demux->movi_start && (demux->stream->flags & STREAM_SEEK)){
+    if(demux->filepos>=demux->movi_end && demux->movi_end>demux->movi_start && (demux->stream->flags & MP_STREAM_SEEK)){
           demux->stream->eof=1;
           return 0;
     }
@@ -442,7 +442,7 @@ static demuxer_t* demux_open_avi(demuxer
   demuxer->priv=(void*)priv;
 
   //---- AVI header:
-  read_avi_header(demuxer,(demuxer->stream->flags & STREAM_SEEK_BW)?index_mode:-2);
+  read_avi_header(demuxer,(demuxer->stream->flags & MP_STREAM_SEEK_BW)?index_mode:-2);
 
   if(demuxer->audio->id>=0 && !demuxer->a_streams[demuxer->audio->id]){
       mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_InvalidAudioStreamNosound,demuxer->audio->id);

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/libmpdemux/demux_lavf.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -465,7 +465,7 @@ static demuxer_t* demux_open_lavf(demuxe
 
     priv->pb = av_alloc_put_byte(priv->buffer, BIO_BUFFER_SIZE, 0,
                                  demuxer->stream, mp_read, NULL, mp_seek);
-    priv->pb->is_streamed = !demuxer->stream->end_pos || (demuxer->stream->flags & STREAM_SEEK) != STREAM_SEEK;
+    priv->pb->is_streamed = !demuxer->stream->end_pos || (demuxer->stream->flags & MP_STREAM_SEEK) != MP_STREAM_SEEK;
 
     if(av_open_input_stream(&avfc, priv->pb, mp_filename, priv->avif, &ap)<0){
         mp_msg(MSGT_HEADER,MSGL_ERR,"LAVF_header: av_open_input_stream() failed\n");

Modified: trunk/libmpdemux/muxer_lavf.c
==============================================================================
--- trunk/libmpdemux/muxer_lavf.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/libmpdemux/muxer_lavf.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -391,7 +391,7 @@ int muxer_init_muxer_lavf(muxer_t *muxer
         }
 
 	priv->oc->pb = av_alloc_put_byte(priv->buffer, BIO_BUFFER_SIZE, 1, muxer, NULL, mp_write, mp_seek);
-	if ((muxer->stream->flags & STREAM_SEEK) != STREAM_SEEK)
+	if ((muxer->stream->flags & MP_STREAM_SEEK) != MP_STREAM_SEEK)
             priv->oc->pb->is_streamed = 1;
 
 	muxer->priv = (void *) priv;

Modified: trunk/stream/http.c
==============================================================================
--- trunk/stream/http.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/http.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -891,7 +891,7 @@ static int fixup_open(stream_t *stream,i
 	stream->type = STREAMTYPE_STREAM;
 	if(!is_icy && !is_ultravox && seekable)
 	{
-		stream->flags |= STREAM_SEEK;
+		stream->flags |= MP_STREAM_SEEK;
 		stream->seek = http_seek;
 	}
 	stream->streaming_ctrl->bandwidth = network_bandwidth;

Modified: trunk/stream/stream.c
==============================================================================
--- trunk/stream/stream.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -174,10 +174,10 @@ stream_t* open_stream_plugin(const strea
   }
   if(s->type <= -2)
     mp_msg(MSGT_OPEN,MSGL_WARN, "Warning streams need a type !!!!\n");
-  if(s->flags & STREAM_SEEK && !s->seek)
-    s->flags &= ~STREAM_SEEK;
-  if(s->seek && !(s->flags & STREAM_SEEK))
-    s->flags |= STREAM_SEEK;
+  if(s->flags & MP_STREAM_SEEK && !s->seek)
+    s->flags &= ~MP_STREAM_SEEK;
+  if(s->seek && !(s->flags & MP_STREAM_SEEK))
+    s->flags |= MP_STREAM_SEEK;
 
   s->mode = mode;
 

Modified: trunk/stream/stream.h
==============================================================================
--- trunk/stream/stream.h	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream.h	Sun Nov 22 16:18:21 2009	(r29962)
@@ -37,10 +37,10 @@
 #define STREAM_READ  0
 #define STREAM_WRITE 1
 /// Seek flags, if not mannualy set and s->seek isn't NULL
-/// STREAM_SEEK is automaticly set
-#define STREAM_SEEK_BW  2
-#define STREAM_SEEK_FW  4
-#define STREAM_SEEK  (STREAM_SEEK_BW|STREAM_SEEK_FW)
+/// MP_STREAM_SEEK is automaticly set
+#define MP_STREAM_SEEK_BW  2
+#define MP_STREAM_SEEK_FW  4
+#define MP_STREAM_SEEK  (MP_STREAM_SEEK_BW|MP_STREAM_SEEK_FW)
 /** This is a HACK for live555 that does not respect the
     separation between stream an demuxer and thus is not
     actually a stream cache can not be used */
@@ -276,7 +276,7 @@ inline static int stream_seek(stream_t *
 }
 
 inline static int stream_skip(stream_t *s,off_t len){
-  if( (len<0 && (s->flags & STREAM_SEEK_BW)) || (len>2*STREAM_BUFFER_SIZE && (s->flags & STREAM_SEEK_FW)) ) {
+  if( (len<0 && (s->flags & MP_STREAM_SEEK_BW)) || (len>2*STREAM_BUFFER_SIZE && (s->flags & MP_STREAM_SEEK_FW)) ) {
     // negative or big skip!
     return stream_seek(s,stream_tell(s)+len);
   }

Modified: trunk/stream/stream_cue.c
==============================================================================
--- trunk/stream/stream_cue.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream_cue.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -578,7 +578,7 @@ static int open_s(stream_t *stream,int m
   stream->fd = f;
   stream->type = STREAMTYPE_VCDBINCUE;
   stream->sector_size = VCD_SECTOR_DATA;
-  stream->flags = STREAM_READ | STREAM_SEEK_FW;
+  stream->flags = STREAM_READ | MP_STREAM_SEEK_FW;
   stream->start_pos = ret;
   stream->end_pos = ret2;
   stream->fill_buffer = cue_vcd_read;

Modified: trunk/stream/stream_dvd.c
==============================================================================
--- trunk/stream/stream_dvd.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream_dvd.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -978,7 +978,7 @@ static int open_s(stream_t *stream,int m
     //    return NULL;
     stream->type = STREAMTYPE_DVD;
     stream->sector_size = 2048;
-    stream->flags = STREAM_READ | STREAM_SEEK;
+    stream->flags = STREAM_READ | MP_STREAM_SEEK;
     stream->fill_buffer = fill_buffer;
     stream->seek = seek;
     stream->control = control;

Modified: trunk/stream/stream_dvdnav.c
==============================================================================
--- trunk/stream/stream_dvdnav.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream_dvdnav.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -596,7 +596,7 @@ static int open_s(stream_t *stream,int m
     dvdnav_angle_change(priv->dvdnav, dvd_angle);
 
   stream->sector_size = 2048;
-  stream->flags = STREAM_READ | STREAM_SEEK;
+  stream->flags = STREAM_READ | MP_STREAM_SEEK;
   stream->fill_buffer = fill_buffer;
   stream->seek = seek;
   stream->control = control;

Modified: trunk/stream/stream_file.c
==============================================================================
--- trunk/stream/stream_file.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream_file.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -159,7 +159,7 @@ static int open_f(stream_t *stream,int m
 #endif
     if(mode == STREAM_READ) stream->seek = seek_forward;
     stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE
-    stream->flags |= STREAM_SEEK_FW;
+    stream->flags |= MP_STREAM_SEEK_FW;
   } else if(len >= 0) {
     stream->seek = seek;
     stream->end_pos = len;

Modified: trunk/stream/stream_netstream.c
==============================================================================
--- trunk/stream/stream_netstream.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream_netstream.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -279,7 +279,7 @@ static int open_s(stream_t *stream,int m
 
   stream->fill_buffer = fill_buffer;
   stream->control = control;
-  if(stream->flags & STREAM_SEEK)
+  if(stream->flags & MP_STREAM_SEEK)
     stream->seek = seek;
   stream->close = close_s;
 

Modified: trunk/stream/stream_smb.c
==============================================================================
--- trunk/stream/stream_smb.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/stream/stream_smb.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -138,7 +138,7 @@ static int open_f (stream_t *stream, int
     smbc_lseek (fd, 0, SEEK_SET);
   }
   if(len > 0 || mode == STREAM_WRITE) {
-    stream->flags |= STREAM_SEEK;
+    stream->flags |= MP_STREAM_SEEK;
     stream->seek = seek;
     if(mode == STREAM_READ) stream->end_pos = len;
   }

Modified: trunk/subreader.c
==============================================================================
--- trunk/subreader.c	Sun Nov 22 16:10:50 2009	(r29961)
+++ trunk/subreader.c	Sun Nov 22 16:18:21 2009	(r29962)
@@ -1085,7 +1085,7 @@ void	subcp_open (stream_t *st)
 		char enca_lang[3], enca_fallback[100];
 		if (sscanf(sub_cp, "enca:%2s:%99s", enca_lang, enca_fallback) == 2
 		     || sscanf(sub_cp, "ENCA:%2s:%99s", enca_lang, enca_fallback) == 2) {
-		  if (st && st->flags & STREAM_SEEK ) {
+		  if (st && st->flags & MP_STREAM_SEEK ) {
 		    cp_tmp = guess_cp(st, enca_lang, enca_fallback);
 		  } else {
 		    cp_tmp = enca_fallback;


More information about the MPlayer-cvslog mailing list