[FFmpeg-devel] [PATCH] ffplay: use format title metadata to set window caption.

Clément Bœsch ubitux at gmail.com
Tue Apr 16 20:11:07 CEST 2013


On Tue, Apr 16, 2013 at 08:07:10PM +0200, Clément Bœsch wrote:
> ---
>  ffplay.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 85e80a8..f3176dc 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -2725,6 +2725,9 @@ static int read_thread(void *arg)
>  
>      is->max_frame_duration = (ic->iformat->flags & AVFMT_TS_DISCONT) ? 10.0 : 3600.0;
>  
> +    if (!window_title && (t = av_dict_get(ic->metadata, "title", NULL, 0)))
> +        window_title = t->value;
> +
>      /* if seeking requested, we execute it */
>      if (start_time != AV_NOPTS_VALUE) {
>          int64_t timestamp;

Alternative attached. Whatever people prefer.

-- 
Clément B.
-------------- next part --------------
From 6f931ca866c5751da2467af531f347bcc2374bc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Tue, 16 Apr 2013 20:07:03 +0200
Subject: [PATCH] ffplay: use format title metadata to set window caption.

---
 ffplay.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index 85e80a8..067c865 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2725,6 +2725,9 @@ static int read_thread(void *arg)
 
     is->max_frame_duration = (ic->iformat->flags & AVFMT_TS_DISCONT) ? 10.0 : 3600.0;
 
+    if (!window_title && (t = av_dict_get(ic->metadata, "title", NULL, 0)))
+        window_title = av_asprintf("%s - %s", t->value, input_filename);
+
     /* if seeking requested, we execute it */
     if (start_time != AV_NOPTS_VALUE) {
         int64_t timestamp;
-- 
1.8.2.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130416/47628e9d/attachment.asc>


More information about the ffmpeg-devel mailing list