graph2dot: Use the fallback getopt implementation if needed
[libav.git] / tools / graph2dot.c
index 15a9012..e7f487d 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "config.h"
+#if HAVE_UNISTD_H
 #include <unistd.h>             /* getopt */
+#endif
+#include <stdio.h>
+#include <string.h>
 
-#undef HAVE_AV_CONFIG_H
+#include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/audioconvert.h"
 #include "libavfilter/avfiltergraph.h"
 
+#if !HAVE_GETOPT
+#include "compat/getopt.c"
+#endif
+
 static void usage(void)
 {
     printf("Convert a libavfilter graph to a dot file\n");
@@ -81,7 +90,7 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph)
                     av_get_channel_layout_string(buf, sizeof(buf), -1,
                                                  link->channel_layout);
                     fprintf(outfile,
-                            " [ label= \"fmt:%s sr:%"PRId64 " cl:%s\" ]",
+                            " [ label= \"fmt:%s sr:%d cl:%s\" ]",
                             av_get_sample_fmt_name(link->format),
                             link->sample_rate, buf);
                 }