Mercurial > mplayer.hg
comparison gui/util/string.c @ 36459:e6953c9c223a
Add mpctx_get_stream().
This avoids direct context access.
author | ib |
---|---|
date | Tue, 17 Dec 2013 22:40:51 +0000 |
parents | 28ea255e40ce |
children | d66bfbf37cd2 |
comparison
equal
deleted
inserted
replaced
36458:4634a3085efc | 36459:e6953c9c223a |
---|---|
26 | 26 |
27 #include "string.h" | 27 #include "string.h" |
28 #include "gui/interface.h" | 28 #include "gui/interface.h" |
29 #include "gui/app/gui.h" | 29 #include "gui/app/gui.h" |
30 | 30 |
31 #include "access_mpcontext.h" | |
31 #include "config.h" | 32 #include "config.h" |
32 #include "help_mp.h" | 33 #include "help_mp.h" |
33 #include "libavutil/avstring.h" | 34 #include "libavutil/avstring.h" |
34 #include "stream/stream.h" | 35 #include "stream/stream.h" |
35 | 36 |
269 */ | 270 */ |
270 char *TranslateFilename(int how, char *fname, size_t maxlen) | 271 char *TranslateFilename(int how, char *fname, size_t maxlen) |
271 { | 272 { |
272 char *p; | 273 char *p; |
273 size_t len; | 274 size_t len; |
275 stream_t *stream; | |
274 | 276 |
275 switch (guiInfo.StreamType) { | 277 switch (guiInfo.StreamType) { |
276 case STREAMTYPE_FILE: | 278 case STREAMTYPE_FILE: |
277 | 279 |
278 if (guiInfo.Filename && *guiInfo.Filename) { | 280 if (guiInfo.Filename && *guiInfo.Filename) { |
327 | 329 |
328 case STREAMTYPE_TV: | 330 case STREAMTYPE_TV: |
329 case STREAMTYPE_DVB: | 331 case STREAMTYPE_DVB: |
330 | 332 |
331 p = MSGTR_NoChannelName; | 333 p = MSGTR_NoChannelName; |
332 | 334 stream = mpctx_get_stream(guiInfo.mpcontext); |
333 if (guiInfo.mpcontext->stream) | 335 |
334 stream_control(guiInfo.mpcontext->stream, STREAM_CTRL_GET_CURRENT_CHANNEL, &p); | 336 if (stream) |
337 stream_control(stream, STREAM_CTRL_GET_CURRENT_CHANNEL, &p); | |
335 | 338 |
336 av_strlcpy(fname, p, maxlen); | 339 av_strlcpy(fname, p, maxlen); |
337 break; | 340 break; |
338 | 341 |
339 default: | 342 default: |