[MPlayer-cvslog] r36555 - in trunk: access_mpcontext.h gui/util/string.c mplayer.c

ib subversion at mplayerhq.hu
Tue Dec 17 23:40:51 CET 2013


Author: ib
Date: Tue Dec 17 23:40:51 2013
New Revision: 36555

Log:
Add mpctx_get_stream().

This avoids direct context access.

Modified:
   trunk/access_mpcontext.h
   trunk/gui/util/string.c
   trunk/mplayer.c

Modified: trunk/access_mpcontext.h
==============================================================================
--- trunk/access_mpcontext.h	Tue Dec 17 23:31:30 2013	(r36554)
+++ trunk/access_mpcontext.h	Tue Dec 17 23:40:51 2013	(r36555)
@@ -28,5 +28,6 @@ void *mpctx_get_mixer(struct MPContext *
 int mpctx_get_global_sub_size(struct MPContext *mpctx);
 int mpctx_get_global_sub_pos(struct MPContext *mpctx);
 int mpctx_get_osd_function(struct MPContext *mpctx);
+void *mpctx_get_stream(struct MPContext *mpctx);
 
 #endif /* MPLAYER_ACCESS_MPCONTEXT_H */

Modified: trunk/gui/util/string.c
==============================================================================
--- trunk/gui/util/string.c	Tue Dec 17 23:31:30 2013	(r36554)
+++ trunk/gui/util/string.c	Tue Dec 17 23:40:51 2013	(r36555)
@@ -28,6 +28,7 @@
 #include "gui/interface.h"
 #include "gui/app/gui.h"
 
+#include "access_mpcontext.h"
 #include "config.h"
 #include "help_mp.h"
 #include "libavutil/avstring.h"
@@ -271,6 +272,7 @@ char *TranslateFilename(int how, char *f
 {
     char *p;
     size_t len;
+    stream_t *stream;
 
     switch (guiInfo.StreamType) {
     case STREAMTYPE_FILE:
@@ -329,9 +331,10 @@ char *TranslateFilename(int how, char *f
     case STREAMTYPE_DVB:
 
         p = MSGTR_NoChannelName;
+        stream = mpctx_get_stream(guiInfo.mpcontext);
 
-        if (guiInfo.mpcontext->stream)
-            stream_control(guiInfo.mpcontext->stream, STREAM_CTRL_GET_CURRENT_CHANNEL, &p);
+        if (stream)
+            stream_control(stream, STREAM_CTRL_GET_CURRENT_CHANNEL, &p);
 
         av_strlcpy(fname, p, maxlen);
         break;

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Tue Dec 17 23:31:30 2013	(r36554)
+++ trunk/mplayer.c	Tue Dec 17 23:40:51 2013	(r36555)
@@ -375,6 +375,11 @@ int mpctx_get_osd_function(MPContext *mp
     return mpctx->osd_function;
 }
 
+void *mpctx_get_stream(MPContext *mpctx)
+{
+    return mpctx->stream;
+}
+
 static int is_valid_metadata_type(metadata_t type)
 {
     switch (type) {


More information about the MPlayer-cvslog mailing list