changeset 16750:0a31740dd5e6

Use PRI?64 defines as format strings for 64 bit variables.
author reimar
date Thu, 13 Oct 2005 18:33:56 +0000
parents a3e5975a7618
children d9465442eef2
files libmpdemux/aviprint.c libmpdemux/cache2.c libmpdemux/demux_aac.c libmpdemux/demux_mkv.c libmpdemux/demux_ogg.c libmpdemux/demux_ts.c libmpdemux/demux_ty.c libmpdemux/demux_vqf.c libmpdemux/muxer_lavf.c libmpdemux/muxer_mpeg.c libmpdemux/network.c libmpdemux/stream.c libmpdemux/stream_file.c libmpdemux/stream_ftp.c m_option.c
diffstat 15 files changed, 52 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/aviprint.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/aviprint.c	Thu Oct 13 18:33:56 2005 +0000
@@ -157,7 +157,7 @@
     mp_msg (MSGT_HEADER, MSGL_V, "  FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry);
     mp_msg (MSGT_HEADER, MSGL_V, "  bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType);
     mp_msg (MSGT_HEADER, MSGL_V, "  nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId);
-    mp_msg (MSGT_HEADER, MSGL_V, "  qwBaseOffset (0x%llX) dwReserved3 (%d)\n", h->qwBaseOffset, h->dwReserved3);
+    mp_msg (MSGT_HEADER, MSGL_V, "  qwBaseOffset (0x%"PRIX64") dwReserved3 (%d)\n", h->qwBaseOffset, h->dwReserved3);
     mp_msg (MSGT_HEADER, MSGL_V, "===========================\n");
 }
 void print_avisuperindex_chunk(avisuperindex_chunk *h){
--- a/libmpdemux/cache2.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/cache2.c	Thu Oct 13 18:33:56 2005 +0000
@@ -362,11 +362,7 @@
 //  stream->buf_pos=stream->buf_len=0;
 //  return 1;
 
-#ifdef _LARGEFILE_SOURCE
-  mp_msg(MSGT_CACHE,MSGL_V,"cache_stream_seek: WARNING! Can't seek to 0x%llX !\n",(long long)(pos+newpos));
-#else
-  mp_msg(MSGT_CACHE,MSGL_V,"cache_stream_seek: WARNING! Can't seek to 0x%X !\n",(pos+newpos));
-#endif
+  mp_msg(MSGT_CACHE,MSGL_V,"cache_stream_seek: WARNING! Can't seek to 0x%"PRIX64" !\n",(int64_t)(pos+newpos));
   return 0;
 }
 
--- a/libmpdemux/demux_aac.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/demux_aac.c	Thu Oct 13 18:33:56 2005 +0000
@@ -121,7 +121,7 @@
 	if(cnt < 8)
 		goto fail;
 	
-	mp_msg(MSGT_DEMUX, MSGL_V, "demux_aac_probe, INIT: %llu, PROBED: %llu, cnt: %d\n", init, probed, cnt);
+	mp_msg(MSGT_DEMUX, MSGL_V, "demux_aac_probe, INIT: %"PRIu64", PROBED: %"PRIu64", cnt: %d\n", init, probed, cnt);
 	return DEMUXER_TYPE_AAC;
 
 fail:
--- a/libmpdemux/demux_mkv.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/demux_mkv.c	Thu Oct 13 18:33:56 2005 +0000
@@ -636,7 +636,7 @@
             if (num == EBML_UINT_INVALID)
               return 1;
             mkv_d->tc_scale = num;
-            mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] | + timecode scale: %llu\n",
+            mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] | + timecode scale: %"PRIu64"\n",
                     mkv_d->tc_scale);
             break;
           }
@@ -1262,7 +1262,7 @@
           mkv_d->indexes[mkv_d->num_indexes].timecode = time;
           mkv_d->indexes[mkv_d->num_indexes].filepos =mkv_d->segment_start+pos;
           mp_msg (MSGT_DEMUX, MSGL_DBG2, "[mkv] |+ found cue point "
-                  "for track %llu: timecode %llu, filepos: %llu\n", 
+                  "for track %"PRIu64": timecode %"PRIu64", filepos: %"PRIu64"\n", 
                   track, time, mkv_d->segment_start + pos);
           mkv_d->num_indexes++;
         }
--- a/libmpdemux/demux_ogg.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/demux_ogg.c	Thu Oct 13 18:33:56 2005 +0000
@@ -665,7 +665,7 @@
   if(index_mode == 2) mp_msg(MSGT_DEMUX,MSGL_INFO,"\n");
 
   if(index_mode == 2) mp_msg(MSGT_DEMUX,MSGL_V,"Ogg syncpoints table builed: %d syncpoints\n",ogg_d->num_syncpoint);
-  mp_msg(MSGT_DEMUX,MSGL_V,"Ogg stream length (granulepos): %lld\n",ogg_d->final_granulepos);
+  mp_msg(MSGT_DEMUX,MSGL_V,"Ogg stream length (granulepos): %"PRId64"\n",ogg_d->final_granulepos);
 
   stream_reset(s);
   stream_seek(s,demuxer->movi_start);
--- a/libmpdemux/demux_ts.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/demux_ts.c	Thu Oct 13 18:33:56 2005 +0000
@@ -322,7 +322,7 @@
 		}
 	}
 
-	mp_msg(MSGT_DEMUX, MSGL_V, "TRIED UP TO POSITION %llu, FOUND %x, packet_size= %d, SEEMS A TS? %d\n", (uint64_t) pos, c, size, is_ts);
+	mp_msg(MSGT_DEMUX, MSGL_V, "TRIED UP TO POSITION %"PRIu64", FOUND %x, packet_size= %d, SEEMS A TS? %d\n", (uint64_t) pos, c, size, is_ts);
 	stream_seek(demuxer->stream, pos);
 
 	if(! is_ts)
@@ -547,7 +547,7 @@
 	has_tables = 0;
 	memset(pes_priv1, 0, sizeof(pes_priv1));
 	init_pos = stream_tell(demuxer->stream);
-	mp_msg(MSGT_DEMUXER, MSGL_INFO, "PROBING UP TO %llu, PROG: %d\n", (uint64_t) param->probe, param->prog);
+	mp_msg(MSGT_DEMUXER, MSGL_INFO, "PROBING UP TO %"PRIu64", PROG: %d\n", (uint64_t) param->probe, param->prog);
 	while((pos <= init_pos + param->probe) && (! demuxer->stream->eof))
 	{
 		pos = stream_tell(demuxer->stream);
@@ -952,7 +952,7 @@
 	}
 
 
-	mp_msg(MSGT_DEMUXER,MSGL_INFO, "Opened TS demuxer, audio: %x(pid %d), video: %x(pid %d)...POS=%llu\n", params.atype, demuxer->audio->id, params.vtype, demuxer->video->id, (uint64_t) start_pos);
+	mp_msg(MSGT_DEMUXER,MSGL_INFO, "Opened TS demuxer, audio: %x(pid %d), video: %x(pid %d)...POS=%"PRIu64"\n", params.atype, demuxer->audio->id, params.vtype, demuxer->video->id, (uint64_t) start_pos);
 
 
 	start_pos = (start_pos <= priv->ts.packet_size ? 0 : start_pos - priv->ts.packet_size);
@@ -1154,7 +1154,7 @@
 			}
 			
 			pes_es->pts = (float) v / (float) sl->ts_resolution;
-			mp_msg(MSGT_DEMUXER,MSGL_DBG2, "CTS: %d bits, value: %llu/%d = %.3f\n", sl->ts_len, v, sl->ts_resolution, pes_es->pts);
+			mp_msg(MSGT_DEMUXER,MSGL_DBG2, "CTS: %d bits, value: %"PRIu64"/%d = %.3f\n", sl->ts_len, v, sl->ts_resolution, pes_es->pts);
 		}
 		
 		
@@ -1755,7 +1755,7 @@
 	else	//no support for fixed durations atm
 		sl->timescale = sl->au_duration = sl->cts_duration = 0;
 	
-	mp_msg(MSGT_DEMUX, MSGL_V, "MP4SLCONFIG(len=0x%x), predef: %d, flags: %x, use_ts: %d, tslen: %d, timescale: %d, dts: %llu, cts: %llu\n", 
+	mp_msg(MSGT_DEMUX, MSGL_V, "MP4SLCONFIG(len=0x%x), predef: %d, flags: %x, use_ts: %d, tslen: %d, timescale: %d, dts: %"PRIu64", cts: %"PRIu64"\n", 
 		len, buf[0], sl->flags, sl->use_ts, sl->ts_len, sl->timescale, (uint64_t) sl->dts, (uint64_t) sl->cts);
 	
 	return len;
--- a/libmpdemux/demux_ty.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/demux_ty.c	Thu Oct 13 18:33:56 2005 +0000
@@ -240,13 +240,13 @@
          mp_msg
          ( 
             MSGT_DEMUX, MSGL_DBG3,
-           "tmf_filetoparts(): size %lld\n",
+           "tmf_filetoparts(): size %"PRId64"\n",
            tivo->tmfparts[ parts ].fileSize
          );
          mp_msg
          ( 
             MSGT_DEMUX, MSGL_DBG3,
-           "tmf_filetoparts(): startOffset %lld\n",
+           "tmf_filetoparts(): startOffset %"PRId64"\n",
            tivo->tmfparts[ parts ].startOffset
          );
          parts++;
@@ -283,7 +283,7 @@
       tivo->tmf_totalchunks += ( tivo->tmfparts[ index ].fileSize / CHUNKSIZE );
    }
    mp_msg( MSGT_DEMUX, MSGL_DBG3,
-      "tmf_filetoparts():total size %lld\n", tivo->tmf_totalsize );
+      "tmf_filetoparts():total size %"PRId64"\n", tivo->tmf_totalsize );
    mp_msg( MSGT_DEMUX, MSGL_DBG3,
       "tmf_filetoparts():total chunks %d\n", tivo->tmf_totalchunks );
 
@@ -317,7 +317,7 @@
    mp_msg
    ( 
       MSGT_DEMUX, MSGL_DBG3, 
-      "tmf_filetooffset() offset %llx\n", *offset
+      "tmf_filetooffset() offset %"PRIx64"\n", *offset
    );
 }
 
@@ -728,7 +728,7 @@
                      tivo->size = numberParts * TIVO_PART_LENGTH;
                      tivo->size += size;
                      mp_msg( MSGT_DEMUX, MSGL_DBG3, 
-                        "ty:Header Calc Stream Size %lld\n", tivo->size );
+                        "ty:Header Calc Stream Size %"PRId64"\n", tivo->size );
                   }
                }
             }
@@ -754,13 +754,13 @@
    // Give a clue as to where we are in the stream
    // ======================================================================
    mp_msg( MSGT_DEMUX, MSGL_DBG3,
-      "ty:ty header size %llx\n", tivo->size );
+      "ty:ty header size %"PRIx64"\n", tivo->size );
    mp_msg( MSGT_DEMUX, MSGL_DBG3,
-      "ty:ty which Chunk %llx\n", tivo->whichChunk );
+      "ty:ty which Chunk %"PRIx64"\n", tivo->whichChunk );
    mp_msg( MSGT_DEMUX, MSGL_DBG3,
-      "ty:file end_pos   %llx\n", demux->stream->end_pos );
+      "ty:file end_pos   %"PRIx64"\n", demux->stream->end_pos );
    mp_msg( MSGT_DEMUX, MSGL_DBG3,
-      "\nty:wanted current offset %llx\n", stream_tell( demux->stream ) );
+      "\nty:wanted current offset %"PRIx64"\n", stream_tell( demux->stream ) );
 
    if ( tivo->size > 0 )
    {
@@ -826,7 +826,7 @@
       }
    }   
    mp_msg( MSGT_DEMUX, MSGL_DBG3,
-      "\nty:actual current offset %llx\n", ( stream_tell( demux->stream ) - 
+      "\nty:actual current offset %"PRIx64"\n", ( stream_tell( demux->stream ) - 
 		0x20000 ) );
 
 
--- a/libmpdemux/demux_vqf.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/demux_vqf.c	Thu Oct 13 18:33:56 2005 +0000
@@ -143,7 +143,7 @@
     {
     demuxer->movi_start=stream_tell(s);
     demuxer->movi_end=demuxer->movi_start+chunk_size-8;
-    mp_msg(MSGT_DEMUX, MSGL_V, "Found data at %llX size %llu\n",demuxer->movi_start,demuxer->movi_end);
+    mp_msg(MSGT_DEMUX, MSGL_V, "Found data at %"PRIX64" size %"PRIu64"\n",demuxer->movi_start,demuxer->movi_end);
     /* Done! play it */
     break;
     }
--- a/libmpdemux/muxer_lavf.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/muxer_lavf.c	Thu Oct 13 18:33:56 2005 +0000
@@ -69,7 +69,7 @@
 static offset_t mp_seek(URLContext *h, offset_t pos, int whence)
 {
 	muxer_t *muxer = (muxer_t*)h->priv_data;
-	fprintf(stderr, "SEEK %llu\n", pos);
+	fprintf(stderr, "SEEK %"PRIu64"\n", (int64_t)pos);
 	return fseeko(muxer->file, pos, whence);
 }
 
--- a/libmpdemux/muxer_mpeg.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/muxer_mpeg.c	Thu Oct 13 18:33:56 2005 +0000
@@ -863,7 +863,7 @@
 	{
 		spriv = (muxer_headers_t *) s->priv;
 		
-		mp_msg(MSGT_MUXER, MSGL_DBG2, "\nwrite_mpeg_pack(MUX=%d, len=%u, rate=%u, id=%X, pts: %llu, dts: %llu, scr: %llu, PACK_size:%u\n", 
+		mp_msg(MSGT_MUXER, MSGL_DBG2, "\nwrite_mpeg_pack(MUX=%d, len=%u, rate=%u, id=%X, pts: %"PRIu64", dts: %"PRIu64", scr: %"PRIu64", PACK_size:%u\n", 
 		priv->mux, len, muxer->sysrate, s->ckid, spriv->pts, spriv->dts, priv->scr, priv->packet_size);
 		
 		//stflen is the count of stuffing bytes in the pes header itself, 
@@ -1154,7 +1154,7 @@
 		next_pts = apriv->last_pts;
 	apriv->last_dts = apriv->pts;
 	apriv->pts = next_pts;
-	mp_msg(MSGT_MUXER, MSGL_DBG2, "\nAUDIO: tot=%llu, sz=%u bytes, FRAMES: %llu * %u, REST: %u, DELTA_PTS: %u\n", 
+	mp_msg(MSGT_MUXER, MSGL_DBG2, "\nAUDIO: tot=%"PRIu64", sz=%u bytes, FRAMES: %"PRIu64" * %u, REST: %u, DELTA_PTS: %u\n", 
 		apriv->size, sz, num_frames, (uint32_t) apriv->frame_size, (uint32_t) rest, (uint32_t) ((num_frames * apriv->delta_pts) >> 10));
 	
 	if(((priv->scr + (63000*1024)) < next_pts) && (priv->scr < apriv->pts) && (! force))
@@ -1239,11 +1239,11 @@
 			mp_msg(MSGT_MUXER, MSGL_ERR, "\nWARNING: SCR: << APTS, DELTA=%.3lf secs, COMPENSATE=%d, BR: %d\n", 
 				(((double) tmp)/92160000.0), apriv->compensate, apriv->bitrate);
 		else if(apriv->pts < priv->scr)
-			mp_msg(MSGT_MUXER, MSGL_ERR, "\nERROR: SCR: %llu, APTS: %llu, DELTA=-%.3lf secs, COMPENSATE=%d, BR: %d, lens: %d/%d, frames: %d\n", 
+			mp_msg(MSGT_MUXER, MSGL_ERR, "\nERROR: SCR: %"PRIu64", APTS: %"PRIu64", DELTA=-%.3lf secs, COMPENSATE=%d, BR: %d, lens: %d/%d, frames: %d\n", 
 				priv->scr, apriv->pts, (double) ((priv->scr - apriv->pts)/92160000.0), apriv->compensate, apriv->bitrate, tlen, len, n);
 	}
 
-	mp_msg(MSGT_MUXER, MSGL_DBG2, "\nWRITTEN AUDIO: %u bytes, TIMER: %.3lf, FRAMES: %llu * %u, DELTA_PTS: %.3lf\n", 
+	mp_msg(MSGT_MUXER, MSGL_DBG2, "\nWRITTEN AUDIO: %u bytes, TIMER: %.3lf, FRAMES: %"PRIu64" * %u, DELTA_PTS: %.3lf\n", 
 		len, (double) (apriv->pts/92160000), num_frames, (uint32_t) apriv->frame_size, delta_pts);
 	
 	return len;
@@ -1263,7 +1263,7 @@
 	else
 		size1 = (div) * apriv->frame_size;
 
-	mp_msg(MSGT_MUXER, MSGL_V, "SIZE1: %llu, LEN: %llu\n", size1, (uint64_t)as->b_buffer_len);
+	mp_msg(MSGT_MUXER, MSGL_V, "SIZE1: %"PRIu64", LEN: %"PRIu64"\n", size1, (uint64_t)as->b_buffer_len);
 	size1 = min(size1, as->b_buffer_len);
 	memmove(as->b_buffer, &(as->b_buffer[size]), as->b_buffer_len - size1);
 	as->b_buffer_len -= size1;
@@ -1272,7 +1272,7 @@
 	rest_pts = (double) rest / (double) apriv->bitrate;
 	apriv->pts += (int64_t) (92160000.0 * rest_pts);
 	apriv->last_pts += (int64_t) (92160000.0 * rest_pts);
-	mp_msg(MSGT_MUXER, MSGL_DBG2, "DROPPED: %lld bytes, REST= %lld, REST_PTS: %.3lf, AUDIO_PTS%.3lf\n", size1, rest, rest_pts, (double) (apriv->pts/92160000.0));
+	mp_msg(MSGT_MUXER, MSGL_DBG2, "DROPPED: %"PRId64" bytes, REST= %"PRId64", REST_PTS: %.3lf, AUDIO_PTS%.3lf\n", size1, rest, rest_pts, (double) (apriv->pts/92160000.0));
 }
 
 
@@ -1283,20 +1283,20 @@
 	uint64_t init_pts, last_pts;	//initial value
 	
 	init_pts = apriv->pts;
-	mp_msg(MSGT_MUXER, MSGL_DBG2, "DUR: %llu, DIFF: %llu\n", dur, apriv->pts - init_pts);
+	mp_msg(MSGT_MUXER, MSGL_DBG2, "DUR: %"PRIu64", DIFF: %"PRIu64"\n", dur, apriv->pts - init_pts);
 	while(dur > apriv->pts - init_pts)
 	{
 		priv->scr = (92160000 * apriv->size) / apriv->bitrate;
 		last_pts = apriv->pts;
 		dump_audio(muxer, as, as->b_buffer_len, 0);
-		mp_msg(MSGT_MUXER, MSGL_DBG2, "DUR: %llu, DIFF: %llu, SCR: %llu\n", dur, apriv->pts - init_pts, priv->scr);
+		mp_msg(MSGT_MUXER, MSGL_DBG2, "DUR: %"PRIu64", DIFF: %"PRIu64", SCR: %"PRIu64"\n", dur, apriv->pts - init_pts, priv->scr);
 	}
 	
 	//priv->init_delay_pts = last_pts;
 	priv->init_delay_pts = (90 * 1024 * abs(conf_init_adelay)) + apriv->init_pts - (90 * 1024 * abs(conf_init_vpts));
 	if(priv->init_delay_pts <= priv->scr)
 		priv->init_delay_pts = last_pts;
-	mp_msg(MSGT_MUXER, MSGL_INFO, "INIT_VPTS: %llu (%.3lf)\n", priv->init_delay_pts, (double) (priv->init_delay_pts/92160000.0));
+	mp_msg(MSGT_MUXER, MSGL_INFO, "INIT_VPTS: %"PRIu64" (%.3lf)\n", priv->init_delay_pts, (double) (priv->init_delay_pts/92160000.0));
 }
 
 
@@ -1310,7 +1310,7 @@
 	delta_scr = (uint64_t) (mult * perc);
 	priv->scr += delta_scr;
 	
-	mp_msg(MSGT_MUXER, MSGL_DBG2, "UPDATE SCR TO %llu (%.3lf): mult is %.3lf,  perc: %.3lf, %u/%u, delta: %llu\n", 
+	mp_msg(MSGT_MUXER, MSGL_DBG2, "UPDATE SCR TO %"PRIu64" (%.3lf): mult is %.3lf,  perc: %.3lf, %u/%u, delta: %"PRIu64"\n", 
 		priv->scr, (double) (priv->scr/92160000.0), mult, perc, len, totlen, delta_scr);
 }
 
@@ -2088,7 +2088,7 @@
 	mn = mx = vpriv->framebuf[0].pts;
 	for(i = 0; i < 3; i++) 
 	{
-		mp_msg(MSGT_DECVIDEO,MSGL_DBG2, "PTS: %llu\n", vpriv->framebuf[i].pts);
+		mp_msg(MSGT_DECVIDEO,MSGL_DBG2, "PTS: %"PRIu64"\n", vpriv->framebuf[i].pts);
 		if(vpriv->framebuf[i].pts < mn)
 			mn = vpriv->framebuf[i].pts;
 		if(vpriv->framebuf[i].pts > mx)
@@ -2100,7 +2100,7 @@
 		if((vpriv->framebuf[i].pts > mn) && (vpriv->framebuf[i].pts < mx))
 		md = vpriv->framebuf[i].pts;
 	}
-	mp_msg(MSGT_DECVIDEO,MSGL_DBG2, "MIN: %llu, mid: %llu, max: %llu\n", mn, md, mx);
+	mp_msg(MSGT_DECVIDEO,MSGL_DBG2, "MIN: %"PRIu64", mid: %"PRIu64", max: %"PRIu64"\n", mn, md, mx);
 	
 	if(mx - md > md - mn)
 		diff = md - mn;
@@ -2166,7 +2166,7 @@
 			delta_pts = (92160000 * (int64_t) delta) / vpriv->picture.timeinc_resolution;
 			
 			pt = vpriv->picture.picture_type + 1;
-			mp_msg(MSGT_MUXER, MSGL_DBG2, "\nTYPE: %c, RESOLUTION: %d, TEMP: %d, delta: %d, delta_pts: %lld = %.3lf, delta2: %.3lf\n", 
+			mp_msg(MSGT_MUXER, MSGL_DBG2, "\nTYPE: %c, RESOLUTION: %d, TEMP: %d, delta: %d, delta_pts: %"PRId64" = %.3lf, delta2: %.3lf\n", 
 				FTYPE(pt), vpriv->picture.timeinc_resolution, vpriv->picture.timeinc_unit, delta, delta_pts, (double) (delta_pts/92160000.0),
 				(double) delta / (double) vpriv->picture.timeinc_resolution);
 			
@@ -2199,7 +2199,7 @@
 			vpriv->last_pts += vpriv->frame_duration;
 			vpriv->last_dts = vpriv->framebuf[vpriv->framebuf_used-1].dts;
 			vpriv->delta_clock = ((double) vpriv->frame_duration)/92160000.0;
-			mp_msg(MSGT_MUXER, MSGL_INFO, "FRAME DURATION: %llu   %.3lf\n", 
+			mp_msg(MSGT_MUXER, MSGL_INFO, "FRAME DURATION: %"PRIu64"   %.3lf\n", 
 				vpriv->frame_duration, (double) (vpriv->frame_duration/92160000.0));
 		}
 	}
@@ -2508,12 +2508,12 @@
 		{
 			if(priv->drop)
 			{
-				mp_msg(MSGT_MUXER, MSGL_V, "\nDROPPING %llu AUDIO BYTES, DELAY: %.3lf, BR: %u\n", delay_len, priv->init_adelay, spriv->bitrate);
+				mp_msg(MSGT_MUXER, MSGL_V, "\nDROPPING %"PRIu64" AUDIO BYTES, DELAY: %.3lf, BR: %u\n", delay_len, priv->init_adelay, spriv->bitrate);
 				drop_delayed_audio(muxer, s, (int64_t) delay_len);
 			}
 			else
 			{
-				mp_msg(MSGT_MUXER, MSGL_V, "\nWRITING %llu EARLY AUDIO BYTES, DELAY: %.3lf, BR: %u\n", delay_len, priv->init_adelay, spriv->bitrate);
+				mp_msg(MSGT_MUXER, MSGL_V, "\nWRITING %"PRIu64" EARLY AUDIO BYTES, DELAY: %.3lf, BR: %u\n", delay_len, priv->init_adelay, spriv->bitrate);
 				save_delayed_audio(muxer, s, (uint64_t) (92160000 * (-priv->init_adelay)));
 			}
 			priv->init_adelay = 0.0;
@@ -2569,7 +2569,7 @@
 	if(priv->is_genmpeg1 || priv->is_genmpeg2)
 		write_mpeg_pack(muxer, NULL, muxer->file, NULL, 0, 1);	//insert fake Nav Packet
 		
-	mp_msg(MSGT_MUXER, MSGL_INFO, "\nOverhead: %.3lf%% (%llu / %llu)\n", 100.0 * (double)priv->headers_size / (double)priv->data_size, priv->headers_size, priv->data_size);
+	mp_msg(MSGT_MUXER, MSGL_INFO, "\nOverhead: %.3lf%% (%"PRIu64" / %"PRIu64")\n", 100.0 * (double)priv->headers_size / (double)priv->data_size, priv->headers_size, priv->data_size);
 }
 
 static void mpegfile_write_header(muxer_t *muxer)
--- a/libmpdemux/network.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/network.c	Thu Oct 13 18:33:56 2005 +0000
@@ -408,11 +408,7 @@
 
 	if(pos>0) { 
 	// Extend http_send_request with possibility to do partial content retrieval
-#ifdef __MINGW32__
-	    snprintf(str, 256, "Range: bytes=%I64d-", (int64_t)pos);
-#else
-	    snprintf(str, 256, "Range: bytes=%lld-", (long long)pos);
-#endif
+	    snprintf(str, 256, "Range: bytes=%"PRId64"-", (int64_t)pos);
 	    http_set_field(http_hdr, str);
 	}
 	    
--- a/libmpdemux/stream.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/stream.c	Thu Oct 13 18:33:56 2005 +0000
@@ -268,13 +268,8 @@
   }
 
 if(verbose>=3){
-#ifdef _LARGEFILE_SOURCE
-  printf("s->pos=%llX  newpos=%llX  new_bufpos=%llX  buflen=%X  \n",
-    (long long)s->pos,(long long)newpos,(long long)pos,s->buf_len);
-#else
-  printf("s->pos=%X  newpos=%X  new_bufpos=%X  buflen=%X  \n",
-    (unsigned int)s->pos,newpos,pos,s->buf_len);
-#endif
+  printf("s->pos=%"PRIX64"  newpos=%"PRIX64"  new_bufpos=%"PRIX64"  buflen=%X  \n",
+    (int64_t)s->pos,(int64_t)newpos,(int64_t)pos,s->buf_len);
 }
   pos-=newpos;
 
@@ -333,11 +328,7 @@
   
 //  if(pos==s->buf_len) printf("XXX Seek to last byte of file -> EOF\n");
   
-#ifdef _LARGEFILE_SOURCE
-  mp_msg(MSGT_STREAM,MSGL_V,"stream_seek: WARNING! Can't seek to 0x%llX !\n",(long long)(pos+newpos));
-#else
-  mp_msg(MSGT_STREAM,MSGL_V,"stream_seek: WARNING! Can't seek to 0x%X !\n",(pos+newpos));
-#endif
+  mp_msg(MSGT_STREAM,MSGL_V,"stream_seek: WARNING! Can't seek to 0x%"PRIX64" !\n",(int64_t)(pos+newpos));
   return 0;
 }
 
--- a/libmpdemux/stream_file.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/stream_file.c	Thu Oct 13 18:33:56 2005 +0000
@@ -140,11 +140,7 @@
     stream->type = STREAMTYPE_FILE;
   }
 
-#ifdef _LARGEFILE_SOURCE
-  mp_msg(MSGT_OPEN,MSGL_V,"[file] File size is %lld bytes\n", (long long)len);
-#else
-  mp_msg(MSGT_OPEN,MSGL_V,"[file] File size is %u bytes\n", (unsigned int)len);
-#endif 
+  mp_msg(MSGT_OPEN,MSGL_V,"[file] File size is %"PRId64" bytes\n", (int64_t)len);
 
   stream->fd = f;
   stream->fill_buffer = fill_buffer;
--- a/libmpdemux/stream_ftp.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/libmpdemux/stream_ftp.c	Thu Oct 13 18:33:56 2005 +0000
@@ -307,11 +307,7 @@
   if(!s->fd) return 0;
 
   if(newpos > 0) {
-#ifdef _LARGEFILE_SOURCE
-    snprintf(str,255,"REST %lld\r\n",newpos);
-#else
-    snprintf(str,255,"REST %u\r\n",newpos);
-#endif 
+    snprintf(str,255,"REST %"PRId64"\r\n", (int64_t)newpos);
 
     resp = FtpSendCmd(str,p,rsp_txt);
     if(resp != 3) {
--- a/m_option.c	Thu Oct 13 13:24:35 2005 +0000
+++ b/m_option.c	Thu Oct 13 18:33:56 2005 +0000
@@ -289,7 +289,7 @@
   if (param == NULL)
     return M_OPT_MISSING_PARAM;
   if (sscanf(param, sizeof(off_t) == sizeof(int) ?
-	     "%d%c" : "%lld%c", &tmp_off, &dummy) != 1) {
+	     "%d%c" : "%"PRId64"%c", &tmp_off, &dummy) != 1) {
     mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must be an integer: %s\n",opt->name,param);
     return M_OPT_INVALID;
   }
@@ -297,20 +297,16 @@
   if (opt->flags & M_OPT_MIN)
     if (tmp_off < opt->min) {
       mp_msg(MSGT_CFGPARSER, MSGL_ERR,
-	     (sizeof(off_t) == sizeof(int) ?
-	      "The %s option must be >= %d: %s\n" :
-	      "The %s option must be >= %lld: %s\n"),
-	     name, (off_t) opt->min, param);
+	      "The %s option must be >= %"PRId64": %s\n",
+	     name, (int64_t) opt->min, param);
       return M_OPT_OUT_OF_RANGE;
     }
 
   if (opt->flags & M_OPT_MAX)
     if (tmp_off > opt->max) {
       mp_msg(MSGT_CFGPARSER, MSGL_ERR,
-	     (sizeof(off_t) == sizeof(int) ?
-	      "The %s option must be <= %d: %s\n" :
-	      "The %s option must be <= %lld: %s\n"),
-	     name, (off_t) opt->max, param);
+	      "The %s option must be <= %"PRId64": %s\n",
+	     name, (int64_t) opt->max, param);
       return M_OPT_OUT_OF_RANGE;
     }
 
@@ -320,7 +316,7 @@
 }
 
 static char* print_position(m_option_t* opt,  void* val) {
-  return dup_printf(sizeof(off_t) == sizeof(int) ?  "%d" : "%lld",VAL(val));
+  return dup_printf("%"PRId64,(int64_t)VAL(val));
 }
 
 m_option_type_t m_option_type_position = {