changeset 29920:4f740437ed2b

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).
author reimar
date Sun, 22 Nov 2009 15:18:21 +0000
parents df33ed3dbfa9
children 797bc16b89dc
files 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_dvd.c stream/stream_dvdnav.c stream/stream_file.c stream/stream_netstream.c stream/stream_smb.c subreader.c
diffstat 14 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/libmpdemux/demux_audio.c	Sun Nov 22 15:18:21 2009 +0000
@@ -346,7 +346,7 @@
     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);
--- a/libmpdemux/demux_avi.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/libmpdemux/demux_avi.c	Sun Nov 22 15:18:21 2009 +0000
@@ -237,7 +237,7 @@
     }
 
     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 @@
     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 @@
   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);
--- a/libmpdemux/demux_lavf.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/libmpdemux/demux_lavf.c	Sun Nov 22 15:18:21 2009 +0000
@@ -465,7 +465,7 @@
 
     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");
--- a/libmpdemux/muxer_lavf.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/libmpdemux/muxer_lavf.c	Sun Nov 22 15:18:21 2009 +0000
@@ -391,7 +391,7 @@
         }
 
 	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;
--- a/stream/http.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/http.c	Sun Nov 22 15:18:21 2009 +0000
@@ -891,7 +891,7 @@
 	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;
--- a/stream/stream.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream.c	Sun Nov 22 15:18:21 2009 +0000
@@ -174,10 +174,10 @@
   }
   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;
 
--- a/stream/stream.h	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream.h	Sun Nov 22 15:18:21 2009 +0000
@@ -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_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);
   }
--- a/stream/stream_cue.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream_cue.c	Sun Nov 22 15:18:21 2009 +0000
@@ -578,7 +578,7 @@
   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;
--- a/stream/stream_dvd.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream_dvd.c	Sun Nov 22 15:18:21 2009 +0000
@@ -978,7 +978,7 @@
     //    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;
--- a/stream/stream_dvdnav.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream_dvdnav.c	Sun Nov 22 15:18:21 2009 +0000
@@ -596,7 +596,7 @@
     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;
--- a/stream/stream_file.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream_file.c	Sun Nov 22 15:18:21 2009 +0000
@@ -159,7 +159,7 @@
 #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;
--- a/stream/stream_netstream.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream_netstream.c	Sun Nov 22 15:18:21 2009 +0000
@@ -279,7 +279,7 @@
 
   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;
 
--- a/stream/stream_smb.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/stream/stream_smb.c	Sun Nov 22 15:18:21 2009 +0000
@@ -138,7 +138,7 @@
     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;
   }
--- a/subreader.c	Sun Nov 22 15:10:50 2009 +0000
+++ b/subreader.c	Sun Nov 22 15:18:21 2009 +0000
@@ -1085,7 +1085,7 @@
 		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;