From 4c58f91f48e923644902ad97ebc138fca9ccbf4c Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 26 Dec 2008 16:58:06 +0100 Subject: [PATCH] Put the SDF file name in a variable... --- streamer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/streamer.c b/streamer.c index 38e46b9..10e7f66 100644 --- a/streamer.c +++ b/streamer.c @@ -9,6 +9,7 @@ #include "codec.h" #include "rt.h" +static const char *sdp_file = "sdp.txt"; static const char *vdev = "/dev/video0"; static const char *dst = "224.10.20.30"; static int dport = 20000; @@ -16,12 +17,12 @@ static int width = 352; static int height = 288; static int fps = 25; -static void sdp_print(AVFormatContext *s) +static void sdp_print(AVFormatContext *s, const char *fname) { char sdp[2048]; FILE *f; - f = fopen("sdp.txt", "w"); + f = fopen("fname", "w"); avf_sdp_create(&s, 1, sdp, sizeof(sdp)); fprintf(f, "%s\n", sdp); fclose(f); @@ -87,7 +88,7 @@ int main(int argc, char *argv[]) codec_connect(s->streams[0]->codec, os->streams[0]->codec); out_codec_open(os); dump_format(os, 0, os->filename, 1); - sdp_print(os); + sdp_print(os, sdp_file); done = 0; while (!done) { AVPacket *pkt; -- 2.39.2