]> git.sesse.net Git - ffmpeg/commitdiff
avdevice: migrate to AVFormatContext->url
authorMarton Balint <cus@passwd.hu>
Fri, 29 Dec 2017 22:29:52 +0000 (23:29 +0100)
committerMarton Balint <cus@passwd.hu>
Sun, 28 Jan 2018 22:06:43 +0000 (23:06 +0100)
Signed-off-by: Marton Balint <cus@passwd.hu>
31 files changed:
libavdevice/alsa.c
libavdevice/avfoundation.m
libavdevice/bktr.c
libavdevice/caca.c
libavdevice/decklink_common.cpp
libavdevice/decklink_dec.cpp
libavdevice/decklink_enc.cpp
libavdevice/dshow.c
libavdevice/fbdev_dec.c
libavdevice/fbdev_enc.c
libavdevice/gdigrab.c
libavdevice/iec61883.c
libavdevice/jack.c
libavdevice/lavfi.c
libavdevice/libcdio.c
libavdevice/libndi_newtek_dec.c
libavdevice/libndi_newtek_enc.c
libavdevice/openal-dec.c
libavdevice/opengl_enc.c
libavdevice/oss_dec.c
libavdevice/oss_enc.c
libavdevice/pulse_audio_dec.c
libavdevice/pulse_audio_enc.c
libavdevice/sdl2.c
libavdevice/sndio_dec.c
libavdevice/sndio_enc.c
libavdevice/v4l2.c
libavdevice/v4l2enc.c
libavdevice/vfwcap.c
libavdevice/xcbgrab.c
libavdevice/xv.c

index 1bbff30d5cc43f9a7a27d1d8741be28bf4894f5b..1b21beb6d51e7416dc7c8bca2d0abfbc82acadf3 100644 (file)
@@ -177,8 +177,8 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
     snd_pcm_uframes_t buffer_size, period_size;
     uint64_t layout = ctx->streams[0]->codecpar->channel_layout;
 
-    if (ctx->filename[0] == 0) audio_device = "default";
-    else                       audio_device = ctx->filename;
+    if (ctx->url[0] == 0) audio_device = "default";
+    else                  audio_device = ctx->url;
 
     if (*codec_id == AV_CODEC_ID_NONE)
         *codec_id = DEFAULT_CODEC_ID;
index e2ddf47dbe8dc7dad799d0dd77b274efcf8f487f..a540f6a079246a9918cbd7d7cb293422ee796fa3 100644 (file)
@@ -259,7 +259,7 @@ static void destroy_context(AVFContext* ctx)
 static void parse_device_name(AVFormatContext *s)
 {
     AVFContext *ctx = (AVFContext*)s->priv_data;
-    char *tmp = av_strdup(s->filename);
+    char *tmp = av_strdup(s->url);
     char *save;
 
     if (tmp[0] != ':') {
index 418247dc4eb5ede08a1dc4b28c3c2539865ca5c0..993cc19ac7c796fc3964fb038b5ac2dc0d223a7d 100644 (file)
@@ -294,7 +294,7 @@ static int grab_read_header(AVFormatContext *s1)
     st->codecpar->height = s->height;
     st->avg_frame_rate = framerate;
 
-    if (bktr_init(s1->filename, s->width, s->height, s->standard,
+    if (bktr_init(s1->url, s->width, s->height, s->standard,
                   &s->video_fd, &s->tuner_fd, -1, 0.0) < 0) {
         ret = AVERROR(EIO);
         goto out;
index 93cc0ffd252e9cf50ee1cc757df1f431f20eaa57..47de8247dcf117bd49975570364da909a116371c 100644 (file)
@@ -178,7 +178,7 @@ static int caca_write_header(AVFormatContext *s)
     }
 
     if (!c->window_title)
-        c->window_title = av_strdup(s->filename);
+        c->window_title = av_strdup(s->url);
     caca_set_display_title(c->display, c->window_title);
     caca_set_display_time(c->display, av_rescale_q(1, st->codec->time_base, AV_TIME_BASE_Q));
 
index d1576b85535dc4c98c4ea8dcecefbe4d356a560b..da414ed5f8b8159297e687788a3465522d6e1dc5 100644 (file)
@@ -404,7 +404,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct
     }
 
     av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n\tformat_code\tdescription",
-               avctx->filename);
+               avctx->url);
     while (itermode->Next(&mode) == S_OK) {
         BMDTimeValue tb_num, tb_den;
         mode->GetFrameRate(&tb_num, &tb_den);
index a69e28680be3a38c2a9396109782d911938207b7..5c116f2d1371d0d2a3cf818aea7a63834560dd83 100644 (file)
@@ -951,7 +951,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
         cctx->raw_format = MKBETAG('v','2','1','0');
     }
 
-    strcpy (fname, avctx->filename);
+    av_strlcpy(fname, avctx->url, sizeof(fname));
     tmp=strchr (fname, '@');
     if (tmp != NULL) {
         av_log(avctx, AV_LOG_WARNING, "The @mode syntax is deprecated and will be removed. Please use the -format_code option.\n");
@@ -966,7 +966,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
     /* Get input device. */
     if (ctx->dl->QueryInterface(IID_IDeckLinkInput, (void **) &ctx->dli) != S_OK) {
         av_log(avctx, AV_LOG_ERROR, "Could not open input device from '%s'\n",
-               avctx->filename);
+               avctx->url);
         ret = AVERROR(EIO);
         goto error;
     }
index 89b03f2bd56487c8a41c8841ffb8fdce4edafd2c..28ab928cd50cd92099b41723085267c48793dde2 100644 (file)
@@ -400,14 +400,14 @@ av_cold int ff_decklink_write_header(AVFormatContext *avctx)
         return AVERROR_EXIT;
     }
 
-    ret = ff_decklink_init_device(avctx, avctx->filename);
+    ret = ff_decklink_init_device(avctx, avctx->url);
     if (ret < 0)
         return ret;
 
     /* Get output device. */
     if (ctx->dl->QueryInterface(IID_IDeckLinkOutput, (void **) &ctx->dlo) != S_OK) {
         av_log(avctx, AV_LOG_ERROR, "Could not open output device from '%s'\n",
-               avctx->filename);
+               avctx->url);
         ret = AVERROR(EIO);
         goto error;
     }
index f2453e611447706daff93bbfdca42deb2fbd8301..de910c09943440475d23e3c13f5f0b693b09324a 100644 (file)
@@ -1033,7 +1033,7 @@ static int parse_device_name(AVFormatContext *avctx)
 {
     struct dshow_ctx *ctx = avctx->priv_data;
     char **device_name = ctx->device_name;
-    char *name = av_strdup(avctx->filename);
+    char *name = av_strdup(avctx->url);
     char *tmp = name;
     int ret = 1;
     char *type;
index d9c75df2029b689b4c34bdf659edcf0e2972004c..6a5181686812c7e8eac06b8ccb02adee3a8ca891 100644 (file)
@@ -78,8 +78,8 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
     if (avctx->flags & AVFMT_FLAG_NONBLOCK)
         flags |= O_NONBLOCK;
 
-    if (avctx->filename[0])
-        device = avctx->filename;
+    if (avctx->url[0])
+        device = avctx->url;
     else
         device = ff_fbdev_default_device();
 
index b4e5f849759ff34452376740a2f8522cb5bcf3a4..4191596825069649ed31fedb72d764a8329dfb71 100644 (file)
@@ -53,8 +53,8 @@ static av_cold int fbdev_write_header(AVFormatContext *h)
         return AVERROR(EINVAL);
     }
 
-    if (h->filename[0])
-        device = h->filename;
+    if (h->url[0])
+        device = h->url;
     else
         device = ff_fbdev_default_device();
 
index ff2ef3b1629f34faf7c91791be198cf73de77f02..ab08c1178848143bad92fbaba126fb40b2404525 100644 (file)
@@ -230,7 +230,7 @@ gdigrab_read_header(AVFormatContext *s1)
     HBITMAP hbmp   = NULL;
     void *buffer   = NULL;
 
-    const char *filename = s1->filename;
+    const char *filename = s1->url;
     const char *name     = NULL;
     AVStream   *st       = NULL;
 
index 721dca38eef99c6c2e9aba66c6edac97b5ced1aa..7d4d37847cba7c2d32addad778b7e3d2a9c8a83f 100644 (file)
@@ -259,14 +259,14 @@ static int iec61883_read_header(AVFormatContext *context)
         goto fail;
     }
 
-    inport = strtol(context->filename, &endptr, 10);
-    if (endptr != context->filename && *endptr == '\0') {
+    inport = strtol(context->url, &endptr, 10);
+    if (endptr != context->url && *endptr == '\0') {
         av_log(context, AV_LOG_INFO, "Selecting IEEE1394 port: %d\n", inport);
         j = inport;
         nb_ports = inport + 1;
-    } else if (strcmp(context->filename, "auto")) {
+    } else if (strcmp(context->url, "auto")) {
         av_log(context, AV_LOG_ERROR, "Invalid input \"%s\", you should specify "
-               "\"auto\" for auto-detection, or the port number.\n", context->filename);
+               "\"auto\" for auto-detection, or the port number.\n", context->url);
         goto fail;
     }
 
index e35a4a815aea73fadda3c109094166d3952799b1..34f1c6de97350255c4980eb54cf4665afd18a103 100644 (file)
@@ -150,8 +150,8 @@ static int start_jack(AVFormatContext *context)
     jack_status_t status;
     int i, test;
 
-    /* Register as a JACK client, using the context filename as client name. */
-    self->client = jack_client_open(context->filename, JackNullOption, &status);
+    /* Register as a JACK client, using the context url as client name. */
+    self->client = jack_client_open(context->url, JackNullOption, &status);
     if (!self->client) {
         av_log(context, AV_LOG_ERROR, "Unable to register as a JACK client\n");
         return AVERROR(EIO);
@@ -174,7 +174,7 @@ static int start_jack(AVFormatContext *context)
                                             JackPortIsInput, 0);
         if (!self->ports[i]) {
             av_log(context, AV_LOG_ERROR, "Unable to register port %s:%s\n",
-                   context->filename, str);
+                   context->url, str);
             jack_client_close(self->client);
             return AVERROR(EIO);
         }
index 5273717e6b2340e3c96f0092dfc20f61504b39f2..6f2ae958dcbf788b17f2f218f974fdd4dcde28c8 100644 (file)
@@ -166,7 +166,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
     }
 
     if (!lavfi->graph_str)
-        lavfi->graph_str = av_strdup(avctx->filename);
+        lavfi->graph_str = av_strdup(avctx->url);
 
     /* parse the graph, create a stream for each open output */
     if (!(lavfi->graph = avfilter_graph_alloc()))
index f6d4fce25629ff3b3ab85b4f403c27165d2b467d..a4c9f523373737d3113dd0803d16dc3550b2c49a 100644 (file)
@@ -60,9 +60,9 @@ static av_cold int read_header(AVFormatContext *ctx)
 
     if (!(st = avformat_new_stream(ctx, NULL)))
         return AVERROR(ENOMEM);
-    s->drive = cdio_cddap_identify(ctx->filename, CDDA_MESSAGE_LOGIT, &err);
+    s->drive = cdio_cddap_identify(ctx->url, CDDA_MESSAGE_LOGIT, &err);
     if (!s->drive) {
-        av_log(ctx, AV_LOG_ERROR, "Could not open drive %s.\n", ctx->filename);
+        av_log(ctx, AV_LOG_ERROR, "Could not open drive %s.\n", ctx->url);
         return AVERROR(EINVAL);
     }
     if (err) {
@@ -70,7 +70,7 @@ static av_cold int read_header(AVFormatContext *ctx)
         free(err);
     }
     if ((ret = cdio_cddap_open(s->drive)) < 0 || !s->drive->opened) {
-        av_log(ctx, AV_LOG_ERROR, "Could not open disk in drive %s.\n", ctx->filename);
+        av_log(ctx, AV_LOG_ERROR, "Could not open disk in drive %s.\n", ctx->url);
         return AVERROR(EINVAL);
     }
 
index 2f14f4b03fd77e1fca34eae6878f32b727ede725..4fb719770e57c8cbc0dcdf29e563d85974c93e41 100644 (file)
@@ -149,7 +149,7 @@ static int ndi_read_header(AVFormatContext *avctx)
     }
 
     /* Find available sources. */
-    ret = ndi_find_sources(avctx, avctx->filename, &recv_create_desc.source_to_connect_to);
+    ret = ndi_find_sources(avctx, avctx->url, &recv_create_desc.source_to_connect_to);
     if (ctx->find_sources) {
         return AVERROR_EXIT;
     }
index 6ca6f41b734ed10a1fb9d7c6d668e8a60d121e55..f3603f5a3ad6e8fc023192e173cd1a4ae8eabac0 100644 (file)
@@ -233,7 +233,7 @@ static int ndi_write_header(AVFormatContext *avctx)
     int ret = 0;
     unsigned int n;
     struct NDIContext *ctx = avctx->priv_data;
-    const NDIlib_send_create_t ndi_send_desc = { .p_ndi_name = avctx->filename,
+    const NDIlib_send_create_t ndi_send_desc = { .p_ndi_name = avctx->url,
         .p_groups = NULL, .clock_video = ctx->clock_video, .clock_audio = ctx->clock_audio };
 
     if (!NDIlib_initialize()) {
@@ -260,7 +260,7 @@ static int ndi_write_header(AVFormatContext *avctx)
 
     ctx->ndi_send = NDIlib_send_create(&ndi_send_desc);
     if (!ctx->ndi_send) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to create NDI output %s\n", avctx->filename);
+        av_log(avctx, AV_LOG_ERROR, "Failed to create NDI output %s\n", avctx->url);
         ret = AVERROR_EXTERNAL;
     }
 
index 6eb0efe38f1e35dc73f853af6d15b1594e6c4083..c19048e15d34a1caa7a8f70a4bab54899075dde0 100644 (file)
@@ -139,7 +139,7 @@ static int read_header(AVFormatContext *ctx)
 
     /* Open device for capture */
     ad->device =
-        alcCaptureOpenDevice(ctx->filename[0] ? ctx->filename : NULL,
+        alcCaptureOpenDevice(ctx->url[0] ? ctx->url : NULL,
                              ad->sample_rate,
                              ad->sample_format,
                              ad->sample_rate); /* Maximum 1 second of sample data to be read at once */
index bb6787c6f13ba87d883874ec2de056d2655d0fa9..54c7e610bd52b9a32c8f6d9efc829c7c216b09e0 100644 (file)
@@ -1070,7 +1070,7 @@ static av_cold int opengl_write_header(AVFormatContext *h)
         opengl->window_height = opengl->height;
 
     if (!opengl->window_title && !opengl->no_window)
-        opengl->window_title = av_strdup(h->filename);
+        opengl->window_title = av_strdup(h->url);
 
     if ((ret = opengl_create_window(h)))
         goto fail;
index 6fef96a450711bb0798ec04eef20e9fa335bb3e8..d0dc327dc62731127417429e89f7dd8d5ee03a0a 100644 (file)
@@ -52,7 +52,7 @@ static int audio_read_header(AVFormatContext *s1)
         return AVERROR(ENOMEM);
     }
 
-    ret = ff_oss_audio_open(s1, 0, s1->filename);
+    ret = ff_oss_audio_open(s1, 0, s1->url);
     if (ret < 0) {
         return AVERROR(EIO);
     }
index e7a7b6d40355030c7530296e440d1471f2a2e142..e3172afaa47b9fb0f305a4268e0296ba2f180379 100644 (file)
@@ -46,7 +46,7 @@ static int audio_write_header(AVFormatContext *s1)
     st = s1->streams[0];
     s->sample_rate = st->codecpar->sample_rate;
     s->channels = st->codecpar->channels;
-    ret = ff_oss_audio_open(s1, 1, s1->filename);
+    ret = ff_oss_audio_open(s1, 1, s1->url);
     if (ret < 0) {
         return AVERROR(EIO);
     } else {
index 95a1d6ecfa6204246cf4f150cb66d1fc59b01187..5977fb7e9e5f65914605283fb552767ab9fcdf94 100644 (file)
@@ -158,8 +158,8 @@ static av_cold int pulse_read_header(AVFormatContext *s)
 
     attr.fragsize = pd->fragment_size;
 
-    if (s->filename[0] != '\0' && strcmp(s->filename, "default"))
-        device = s->filename;
+    if (s->url[0] != '\0' && strcmp(s->url, "default"))
+        device = s->url;
 
     if (!(pd->mainloop = pa_threaded_mainloop_new())) {
         pulse_close(s);
index 0efcf0fe7e5c609f22c67d0a5be2023b62ffe772..d430b77272647bfdb0522416e254c92bdc7131e3 100644 (file)
@@ -459,8 +459,8 @@ static av_cold int pulse_write_header(AVFormatContext *h)
     st = h->streams[0];
 
     if (!stream_name) {
-        if (h->filename[0])
-            stream_name = h->filename;
+        if (h->url[0])
+            stream_name = h->url;
         else
             stream_name = "Playback";
     }
index 5d9e91ec2139af7a905570d376a421b8f51249d8..48ed977bebd3518e0cdc3eaafff4419e5e97a0ef 100644 (file)
@@ -165,7 +165,7 @@ static int sdl2_write_header(AVFormatContext *s)
     int flags  = 0;
 
     if (!sdl->window_title)
-        sdl->window_title = av_strdup(s->filename);
+        sdl->window_title = av_strdup(s->url);
 
     if (SDL_WasInit(SDL_INIT_VIDEO)) {
         av_log(s, AV_LOG_WARNING,
index 2d13232bf17a662bef6af560bafaef85ab8cb49c..ebb485a2c7b78f29c4e2ed98db656734b02f0ed3 100644 (file)
@@ -41,7 +41,7 @@ static av_cold int audio_read_header(AVFormatContext *s1)
     if (!st)
         return AVERROR(ENOMEM);
 
-    ret = ff_sndio_open(s1, 0, s1->filename);
+    ret = ff_sndio_open(s1, 0, s1->url);
     if (ret < 0)
         return ret;
 
index 47f500d71e515195872b39e474ab3844377092da..f6dd2901089c2298a4e94e1ea261eca64110395f 100644 (file)
@@ -38,7 +38,7 @@ static av_cold int audio_write_header(AVFormatContext *s1)
     s->sample_rate = st->codecpar->sample_rate;
     s->channels    = st->codecpar->channels;
 
-    ret = ff_sndio_open(s1, 1, s1->filename);
+    ret = ff_sndio_open(s1, 1, s1->url);
 
     return ret;
 }
index f087badf5ca74440ad50396fd36f647c6a614133..10a0ff0dd611ce91c111868076f8697677adcab4 100644 (file)
@@ -106,7 +106,7 @@ struct buff_data {
     int index;
 };
 
-static int device_open(AVFormatContext *ctx)
+static int device_open(AVFormatContext *ctx, const char* device_path)
 {
     struct video_data *s = ctx->priv_data;
     struct v4l2_capability cap;
@@ -147,11 +147,11 @@ static int device_open(AVFormatContext *ctx)
         flags |= O_NONBLOCK;
     }
 
-    fd = v4l2_open(ctx->filename, flags, 0);
+    fd = v4l2_open(device_path, flags, 0);
     if (fd < 0) {
         err = AVERROR(errno);
         av_log(ctx, AV_LOG_ERROR, "Cannot open video device %s: %s\n",
-               ctx->filename, av_err2str(err));
+               device_path, av_err2str(err));
         return err;
     }
 
@@ -840,7 +840,7 @@ static int v4l2_read_header(AVFormatContext *ctx)
         v4l2_log_file = fopen("/dev/null", "w");
 #endif
 
-    s->fd = device_open(ctx);
+    s->fd = device_open(ctx, ctx->url);
     if (s->fd < 0)
         return s->fd;
 
@@ -1042,11 +1042,13 @@ static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_l
         return ret;
     }
     while ((entry = readdir(dir))) {
+        char device_name[256];
+
         if (!v4l2_is_v4l_dev(entry->d_name))
             continue;
 
-        snprintf(ctx->filename, sizeof(ctx->filename), "/dev/%s", entry->d_name);
-        if ((s->fd = device_open(ctx)) < 0)
+        snprintf(device_name, sizeof(device_name), "/dev/%s", entry->d_name);
+        if ((s->fd = device_open(ctx, device_name)) < 0)
             continue;
 
         if (v4l2_ioctl(s->fd, VIDIOC_QUERYCAP, &cap) < 0) {
@@ -1060,7 +1062,7 @@ static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_l
             ret = AVERROR(ENOMEM);
             goto fail;
         }
-        device->device_name = av_strdup(ctx->filename);
+        device->device_name = av_strdup(device_name);
         device->device_description = av_strdup(cap.card);
         if (!device->device_name || !device->device_description) {
             ret = AVERROR(ENOMEM);
index faf6e07f8679671d8b9264bd699149c2eff98d14..85200d0a3631463c1893ab2732860b629615ac4e 100644 (file)
@@ -39,10 +39,10 @@ static av_cold int write_header(AVFormatContext *s1)
     if (s1->flags & AVFMT_FLAG_NONBLOCK)
         flags |= O_NONBLOCK;
 
-    s->fd = open(s1->filename, flags);
+    s->fd = open(s1->url, flags);
     if (s->fd < 0) {
         res = AVERROR(errno);
-        av_log(s1, AV_LOG_ERROR, "Unable to open V4L2 device '%s'\n", s1->filename);
+        av_log(s1, AV_LOG_ERROR, "Unable to open V4L2 device '%s'\n", s1->url);
         return res;
     }
 
index f03d38ac2629c31e5a5a35c9a26ed7f7730c4c81..6a923d99578028962adc7b50be62583d23c886bb 100644 (file)
@@ -256,7 +256,7 @@ static int vfw_read_header(AVFormatContext *s)
     int ret;
     AVRational framerate_q;
 
-    if (!strcmp(s->filename, "list")) {
+    if (!strcmp(s->url, "list")) {
         for (devnum = 0; devnum <= 9; devnum++) {
             char driver_name[256];
             char driver_ver[256];
@@ -279,7 +279,7 @@ static int vfw_read_header(AVFormatContext *s)
     }
 
     /* If atoi fails, devnum==0 and the default device is used */
-    devnum = atoi(s->filename);
+    devnum = atoi(s->url);
 
     ret = SendMessage(ctx->hwnd, WM_CAP_DRIVER_CONNECT, devnum, 0);
     if(!ret) {
index 1968fe02d4f453ee369893b3ee9eeee0a1f8f0f9..6d142abd4fd3a94c535f0d3ae96ba54d4a1a70b3 100644 (file)
@@ -629,14 +629,14 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
     XCBGrabContext *c = s->priv_data;
     int screen_num, ret;
     const xcb_setup_t *setup;
-    char *display_name = av_strdup(s->filename);
+    char *display_name = av_strdup(s->url);
 
     if (!display_name)
         return AVERROR(ENOMEM);
 
-    if (!sscanf(s->filename, "%[^+]+%d,%d", display_name, &c->x, &c->y)) {
+    if (!sscanf(s->url, "%[^+]+%d,%d", display_name, &c->x, &c->y)) {
         *display_name = 0;
-        sscanf(s->filename, "+%d,%d", &c->x, &c->y);
+        sscanf(s->url, "+%d,%d", &c->x, &c->y);
     }
 
     c->conn = xcb_connect(display_name[0] ? display_name : NULL, &screen_num);
@@ -644,7 +644,7 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
 
     if ((ret = xcb_connection_has_error(c->conn))) {
         av_log(s, AV_LOG_ERROR, "Cannot open display %s, error %d.\n",
-               s->filename[0] ? s->filename : "default", ret);
+               s->url[0] ? s->url : "default", ret);
         return AVERROR(EIO);
     }
 
index 185de7569e10a348493be2c922aeb5d796016cf8..c3ed2e48bd25c43e68fd11b0699952806474e47e 100644 (file)
@@ -151,7 +151,7 @@ static int xv_write_header(AVFormatContext *s)
                                          xv->window_width, xv->window_height,
                                          0, 0, 0);
         if (!xv->window_title) {
-            if (!(xv->window_title = av_strdup(s->filename))) {
+            if (!(xv->window_title = av_strdup(s->url))) {
                 ret = AVERROR(ENOMEM);
                 goto fail;
             }