[FFmpeg-cvslog] r23254 - in trunk: ffserver.c libavfilter/parseutils.c libavformat/httpauth.c libavformat/mxfenc.c libavformat/rtpenc.c libavutil/Makefile libavutil/random_seed.c libavutil/random_seed.h

mstorsjo subversion
Sun May 23 10:53:41 CEST 2010


Author: mstorsjo
Date: Sun May 23 10:53:40 2010
New Revision: 23254

Log:
Make ff_random_get_seed public, rename to av_get_random_seed, export the header

Keep an old ff_ named function for binary compatibility until the
next major bump.

Modified:
   trunk/ffserver.c
   trunk/libavfilter/parseutils.c
   trunk/libavformat/httpauth.c
   trunk/libavformat/mxfenc.c
   trunk/libavformat/rtpenc.c
   trunk/libavutil/Makefile
   trunk/libavutil/random_seed.c
   trunk/libavutil/random_seed.h

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/ffserver.c	Sun May 23 10:53:40 2010	(r23254)
@@ -4612,7 +4612,7 @@ int main(int argc, char **argv)
 
     unsetenv("http_proxy");             /* Kill the http_proxy */
 
-    av_lfg_init(&random_state, ff_random_get_seed());
+    av_lfg_init(&random_state, av_get_random_seed());
 
     memset(&sigact, 0, sizeof(sigact));
     sigact.sa_handler = handle_child_exit;

Modified: trunk/libavfilter/parseutils.c
==============================================================================
--- trunk/libavfilter/parseutils.c	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/libavfilter/parseutils.c	Sun May 23 10:53:40 2010	(r23254)
@@ -218,7 +218,7 @@ static int color_table_compare(const voi
 int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
 {
     if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) {
-        int rgba = ff_random_get_seed();
+        int rgba = av_get_random_seed();
         rgba_color[0] = rgba >> 24;
         rgba_color[1] = rgba >> 16;
         rgba_color[2] = rgba >> 8;

Modified: trunk/libavformat/httpauth.c
==============================================================================
--- trunk/libavformat/httpauth.c	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/libavformat/httpauth.c	Sun May 23 10:53:40 2010	(r23254)
@@ -200,7 +200,7 @@ static char *make_digest_auth(HTTPAuthSt
 
     /* Generate a client nonce. */
     for (i = 0; i < 2; i++)
-        cnonce_buf[i] = ff_random_get_seed();
+        cnonce_buf[i] = av_get_random_seed();
     ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), 1);
     cnonce[2*sizeof(cnonce_buf)] = 0;
 

Modified: trunk/libavformat/mxfenc.c
==============================================================================
--- trunk/libavformat/mxfenc.c	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/libavformat/mxfenc.c	Sun May 23 10:53:40 2010	(r23254)
@@ -1389,7 +1389,7 @@ static uint64_t mxf_parse_timestamp(time
 static void mxf_gen_umid(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    uint32_t seed = ff_random_get_seed();
+    uint32_t seed = av_get_random_seed();
     uint64_t umid = seed + 0x5294713400000000LL;
 
     AV_WB64(mxf->umid  , umid);

Modified: trunk/libavformat/rtpenc.c
==============================================================================
--- trunk/libavformat/rtpenc.c	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/libavformat/rtpenc.c	Sun May 23 10:53:40 2010	(r23254)
@@ -80,10 +80,10 @@ static int rtp_write_header(AVFormatCont
     if (s->payload_type < 0)
         s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == AVMEDIA_TYPE_AUDIO);
 
-    s->base_timestamp = ff_random_get_seed();
+    s->base_timestamp = av_get_random_seed();
     s->timestamp = s->base_timestamp;
     s->cur_timestamp = 0;
-    s->ssrc = ff_random_get_seed();
+    s->ssrc = av_get_random_seed();
     s->first_packet = 1;
     s->first_rtcp_ntp_time = ff_ntp_time();
     if (s1->start_time_realtime)

Modified: trunk/libavutil/Makefile
==============================================================================
--- trunk/libavutil/Makefile	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/libavutil/Makefile	Sun May 23 10:53:40 2010	(r23254)
@@ -19,6 +19,7 @@ HEADERS = adler32.h                     
           mem.h                                                         \
           pixdesc.h                                                     \
           pixfmt.h                                                      \
+          random_seed.h                                                 \
           rational.h                                                    \
           sha1.h                                                        \
 

Modified: trunk/libavutil/random_seed.c
==============================================================================
--- trunk/libavutil/random_seed.c	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/libavutil/random_seed.c	Sun May 23 10:53:40 2010	(r23254)
@@ -22,8 +22,9 @@
 #include <fcntl.h>
 #include "timer.h"
 #include "random_seed.h"
+#include "avutil.h"
 
-uint32_t ff_random_get_seed(void)
+uint32_t av_get_random_seed(void)
 {
     uint32_t seed;
     int fd;
@@ -42,3 +43,11 @@ uint32_t ff_random_get_seed(void)
     // XXX what to do ?
     return seed;
 }
+
+#if LIBAVUTIL_VERSION_MAJOR < 51
+attribute_deprecated uint32_t ff_random_get_seed(void);
+uint32_t ff_random_get_seed(void)
+{
+    return av_get_random_seed();
+}
+#endif

Modified: trunk/libavutil/random_seed.h
==============================================================================
--- trunk/libavutil/random_seed.h	Sat May 22 23:52:06 2010	(r23253)
+++ trunk/libavutil/random_seed.h	Sun May 23 10:53:40 2010	(r23254)
@@ -26,6 +26,6 @@
 /**
  * Gets a seed to use in conjunction with random functions.
  */
-uint32_t ff_random_get_seed(void);
+uint32_t av_get_random_seed(void);
 
 #endif /* AVUTIL_RANDOM_SEED_H */



More information about the ffmpeg-cvslog mailing list