Mercurial > mplayer.hg
changeset 34077:deff81b57903
Cosmetic: Order STREAMTYPE related code.
Always choose order FILE, STREAM, VCD, DVD for reasons of clarity.
author | ib |
---|---|
date | Fri, 30 Sep 2011 15:28:01 +0000 |
parents | 6a0bda5e63ac |
children | 0be10e21f6ac |
files | gui/interface.c gui/ui/actions.c gui/ui/gtk/menu.c gui/ui/main.c gui/ui/render.c |
diffstat | 5 files changed, 58 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/interface.c Fri Sep 30 15:13:01 2011 +0000 +++ b/gui/interface.c Fri Sep 30 15:28:01 2011 +0000 @@ -603,6 +603,13 @@ guiInfo.StreamType = stream->type; switch (guiInfo.StreamType) { +#ifdef CONFIG_VCD + case STREAMTYPE_VCD: + guiInfo.Tracks = 0; + stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Tracks); + break; +#endif + #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: dvd = stream->priv; @@ -619,13 +626,6 @@ break; #endif -#ifdef CONFIG_VCD - case STREAMTYPE_VCD: - guiInfo.Tracks = 0; - stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Tracks); - break; -#endif - default: break; }
--- a/gui/ui/actions.c Fri Sep 30 15:13:01 2011 +0000 +++ b/gui/ui/actions.c Fri Sep 30 15:28:01 2011 +0000 @@ -242,13 +242,13 @@ return; switch (guiInfo.StreamType) { -#ifdef CONFIG_DVDREAD - case STREAMTYPE_DVD: +#ifdef CONFIG_VCD + case STREAMTYPE_VCD: break; #endif -#ifdef CONFIG_VCD - case STREAMTYPE_VCD: +#ifdef CONFIG_DVDREAD + case STREAMTYPE_DVD: break; #endif @@ -281,6 +281,15 @@ return; switch (guiInfo.StreamType) { +#ifdef CONFIG_VCD + case STREAMTYPE_VCD: + if (--guiInfo.Track == 1) { + guiInfo.Track = 2; + stop = 1; + } + break; +#endif + #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: @@ -296,15 +305,6 @@ break; #endif -#ifdef CONFIG_VCD - case STREAMTYPE_VCD: - if (--guiInfo.Track == 1) { - guiInfo.Track = 2; - stop = 1; - } - break; -#endif - default: prev = listSet(gtkGetPrevPlItem, NULL); @@ -335,6 +335,17 @@ return; switch (guiInfo.StreamType) { +#ifdef CONFIG_VCD + case STREAMTYPE_VCD: + + if (++guiInfo.Track >= guiInfo.Tracks) { + stop = (guiInfo.Track > guiInfo.Tracks); + guiInfo.Track = FFMAX(2, guiInfo.Tracks); + } + + break; +#endif + #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: @@ -350,17 +361,6 @@ break; #endif -#ifdef CONFIG_VCD - case STREAMTYPE_VCD: - - if (++guiInfo.Track >= guiInfo.Tracks) { - stop = (guiInfo.Track > guiInfo.Tracks); - guiInfo.Track = FFMAX(2, guiInfo.Tracks); - } - - break; -#endif - default: next = listSet(gtkGetNextPlItem, NULL);
--- a/gui/ui/gtk/menu.c Fri Sep 30 15:13:01 2011 +0000 +++ b/gui/ui/gtk/menu.c Fri Sep 30 15:28:01 2011 +0000 @@ -66,6 +66,10 @@ #include "gui/ui/pixmaps/empty.xpm" #include "gui/ui/pixmaps/loadeaf.xpm" #include "gui/ui/pixmaps/title.xpm" +#ifdef CONFIG_VCD +#include "gui/ui/pixmaps/vcd.xpm" +#include "gui/ui/pixmaps/playvcd.xpm" +#endif #ifdef CONFIG_DVDREAD #include "gui/ui/pixmaps/dvd.xpm" #include "gui/ui/pixmaps/playdvd.xpm" @@ -75,10 +79,6 @@ #include "gui/ui/pixmaps/sublang.xpm" #include "gui/ui/pixmaps/empty1px.xpm" #endif -#ifdef CONFIG_VCD -#include "gui/ui/pixmaps/vcd.xpm" -#include "gui/ui/pixmaps/playvcd.xpm" -#endif static void ActivateMenuItem( int Item ) {
--- a/gui/ui/main.c Fri Sep 30 15:13:01 2011 +0000 +++ b/gui/ui/main.c Fri Sep 30 15:28:01 2011 +0000 @@ -56,9 +56,9 @@ #include "mpcommon.h" #define CLEAR_FILE 1 -#define CLEAR_DVD 2 -#define CLEAR_VCD 4 -#define CLEAR_ALL (CLEAR_FILE + CLEAR_DVD + CLEAR_VCD) +#define CLEAR_VCD 2 +#define CLEAR_DVD 4 +#define CLEAR_ALL (CLEAR_FILE + CLEAR_VCD + CLEAR_DVD) #define GUI_REDRAW_WAIT 375 @@ -113,6 +113,10 @@ listSet(gtkDelPl, NULL); } +#ifdef CONFIG_VCD + if (what & CLEAR_VCD) guiInfo.Tracks = 0; +#endif + #ifdef CONFIG_DVDREAD if (what & CLEAR_DVD) { @@ -123,10 +127,6 @@ guiInfo.Angles = 0; } #endif - -#ifdef CONFIG_VCD - if (what & CLEAR_VCD) guiInfo.Tracks = 0; -#endif } static unsigned last_redraw_time = 0; @@ -194,8 +194,8 @@ switch ( guiInfo.StreamType ) { + case STREAMTYPE_FILE: case STREAMTYPE_STREAM: - case STREAMTYPE_FILE: guiInfoMediumClear( CLEAR_ALL - CLEAR_FILE ); if ( !guiInfo.Track ) guiInfo.Track=1; @@ -386,7 +386,7 @@ } wsClearWindow( guiApp.subWindow ); #ifdef CONFIG_DVDREAD - if ( guiInfo.StreamType == STREAMTYPE_DVD || guiInfo.StreamType == STREAMTYPE_VCD ) goto play_dvd_2; + if ( guiInfo.StreamType == STREAMTYPE_VCD || guiInfo.StreamType == STREAMTYPE_DVD ) goto play_dvd_2; else #endif guiInfo.NewPlay=GUI_FILE_NEW;
--- a/gui/ui/render.c Fri Sep 30 15:13:01 2011 +0000 +++ b/gui/ui/render.c Fri Sep 30 15:28:01 2011 +0000 @@ -47,10 +47,6 @@ size_t len; switch (guiInfo.StreamType) { - case STREAMTYPE_STREAM: - av_strlcpy(tmp, guiInfo.Filename, tmplen); - break; - case STREAMTYPE_FILE: if (guiInfo.Filename && guiInfo.Filename[0]) { p = strrchr(guiInfo.Filename, '/'); @@ -72,6 +68,16 @@ av_strlcpy(tmp, MSGTR_NoFileLoaded, tmplen); break; + case STREAMTYPE_STREAM: + av_strlcpy(tmp, guiInfo.Filename, tmplen); + break; + +#ifdef CONFIG_VCD + case STREAMTYPE_VCD: + snprintf(tmp, tmplen, MSGTR_Title, guiInfo.Track - 1); + break; +#endif + #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: if (guiInfo.Chapter) @@ -81,12 +87,6 @@ break; #endif -#ifdef CONFIG_VCD - case STREAMTYPE_VCD: - snprintf(tmp, tmplen, MSGTR_Title, guiInfo.Track - 1); - break; -#endif - default: av_strlcpy(tmp, MSGTR_NoMediaOpened, tmplen); break; @@ -271,16 +271,16 @@ av_strlcat(trbuf, "f", sizeof(trbuf)); break; + case STREAMTYPE_STREAM: + av_strlcat(trbuf, "u", sizeof(trbuf)); + break; + #ifdef CONFIG_VCD case STREAMTYPE_VCD: av_strlcat(trbuf, "v", sizeof(trbuf)); break; #endif - case STREAMTYPE_STREAM: - av_strlcat(trbuf, "u", sizeof(trbuf)); - break; - #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: av_strlcat(trbuf, "d", sizeof(trbuf));