changeset 35462:e671bb33230f

Add video codec name to guiInfo structure.
author ib
date Sun, 02 Dec 2012 01:44:24 +0000
parents b7696c82c72d
children aa395c728975
files gui/interface.c gui/interface.h gui/ui/actions.c gui/ui/render.c
diffstat 4 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Sun Dec 02 00:44:03 2012 +0000
+++ b/gui/interface.c	Sun Dec 02 01:44:24 2012 +0000
@@ -34,6 +34,7 @@
 #include "wm/wsxdnd.h"
 
 #include "access_mpcontext.h"
+#include "codec-cfg.h"
 #include "config.h"
 #include "help_mp.h"
 #include "input/input.h"
@@ -652,6 +653,11 @@
 
         guiInfo.sh_video = data;
 
+        nfree(guiInfo.CodecName);
+
+        if (guiInfo.sh_video)
+            guiInfo.CodecName = strdup(guiInfo.sh_video->codec->name);
+
         state = (guiInfo.StreamType == STREAMTYPE_STREAM ? btnDisabled : btnReleased);
         btnSet(evForward10sec, state);
         btnSet(evBackward10sec, state);
--- a/gui/interface.h	Sun Dec 02 00:44:03 2012 +0000
+++ b/gui/interface.h	Sun Dec 02 01:44:24 2012 +0000
@@ -94,6 +94,8 @@
     sh_video_t *sh_video;
     af_stream_t *afilter;
 
+    char *CodecName;
+
     int VideoWindow;
     int VideoWidth;
     int VideoHeight;
--- a/gui/ui/actions.c	Sun Dec 02 00:44:03 2012 +0000
+++ b/gui/ui/actions.c	Sun Dec 02 01:44:24 2012 +0000
@@ -291,6 +291,8 @@
 {
     uiSetFile(NULL, NULL, STREAMTYPE_DUMMY);
 
+    nfree(guiInfo.CodecName);
+
     guiInfo.Track         = 0;
     guiInfo.Chapter       = 0;
     guiInfo.Angle         = 0;
--- a/gui/ui/render.c	Sun Dec 02 00:44:03 2012 +0000
+++ b/gui/ui/render.c	Sun Dec 02 01:44:24 2012 +0000
@@ -27,9 +27,7 @@
 #include "gui/util/string.h"
 
 #include "access_mpcontext.h"
-#include "codec-cfg.h"
 #include "libavutil/avstring.h"
-#include "libmpdemux/stheader.h"
 #include "mixer.h"
 #include "osdep/timer.h"
 #include "stream/stream.h"
@@ -150,7 +148,7 @@
                 break;
 
             case 'C':
-                snprintf(tmp, sizeof(tmp), "%s", guiInfo.sh_video ? guiInfo.sh_video->codec->name : "");
+                snprintf(tmp, sizeof(tmp), "%s", guiInfo.CodecName ? guiInfo.CodecName : "");
                 av_strlcat(trbuf, tmp, sizeof(trbuf));
                 break;