From 6d276a9e91e5568dfbde5f48c8a465a038659a00 Mon Sep 17 00:00:00 2001
From: Gildas Bazin <gbazi@altern.org>
Date: Thu, 19 Jan 2006 22:30:37 +0000
Subject: [PATCH] Properly #ifdef muxer-specific parts. Taken from a patch by
 Gildas Bazin < gbazin -- @@ -- altern -- . -- org >

Originally committed as revision 4869 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/mmf.c       |  2 +-
 libavformat/mpegtsenc.c |  2 ++
 libavformat/nut.c       | 12 ++++++------
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 8b20f320031..bf9aa910433 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -24,7 +24,6 @@ typedef struct {
     offset_t data_size;
 } MMFContext;
 
-#ifdef CONFIG_MUXERS
 static int mmf_rates[] = { 4000, 8000, 11025, 22050, 44100 };
 
 static int mmf_rate_code(int rate)
@@ -43,6 +42,7 @@ static int mmf_rate(int code)
     return mmf_rates[code];
 }
 
+#ifdef CONFIG_MUXERS
 /* Copy of end_tag() from avienc.c, but for big-endian chunk size */
 static void end_tag_be(ByteIOContext *pb, offset_t start)
 {
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index e37f657a77b..fafa0a7f787 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -79,6 +79,7 @@ unsigned int mpegts_crc32(const uint8_t *data, int len)
     return crc;
 }
 
+#ifdef CONFIG_MUXERS
 /*********************************************/
 /* mpegts section writer */
 
@@ -729,3 +730,4 @@ AVOutputFormat mpegts_mux = {
     mpegts_write_packet,
     mpegts_write_end,
 };
+#endif // CONFIG_MUXERS
diff --git a/libavformat/nut.c b/libavformat/nut.c
index 8dfb0b5eba8..790f9bd910e 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -394,6 +394,12 @@ static int64_t find_startcode(ByteIOContext *bc, uint64_t code, int64_t pos){
     }
 }
 
+static int64_t lsb2full(StreamContext *stream, int64_t lsb){
+    int64_t mask = (1<<stream->msb_timestamp_shift)-1;
+    int64_t delta= stream->last_pts - mask/2;
+    return  ((lsb - delta)&mask) + delta;
+}
+
 #ifdef CONFIG_MUXERS
 
 static void put_v(ByteIOContext *bc, uint64_t val)
@@ -690,12 +696,6 @@ static int nut_write_header(AVFormatContext *s)
     return 0;
 }
 
-static int64_t lsb2full(StreamContext *stream, int64_t lsb){
-    int64_t mask = (1<<stream->msb_timestamp_shift)-1;
-    int64_t delta= stream->last_pts - mask/2;
-    return  ((lsb - delta)&mask) + delta;
-}
-
 static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     NUTContext *nut = s->priv_data;
-- 
GitLab