# HG changeset patch # User ib # Date 1355147873 0 # Node ID 8b3791b648c674c9caac972b2986b0419239c5ea # Parent 8889d320734fe45d9cb4e454ef38b7fed9be1527 Add a function to unset media information. diff -r 8889d320734f -r 8b3791b648c6 gui/ui/actions.c --- a/gui/ui/actions.c Mon Dec 10 13:54:56 2012 +0000 +++ b/gui/ui/actions.c Mon Dec 10 13:57:53 2012 +0000 @@ -279,18 +279,7 @@ if (type != SAME_STREAMTYPE) { guiInfo.StreamType = type; - - guiInfo.VideoWidth = 0; - guiInfo.VideoHeight = 0; - guiInfo.AudioChannels = 0; - guiInfo.RunningTime = 0; - guiInfo.Track = 0; - guiInfo.Chapter = 0; - guiInfo.Angle = 0; - - nfree(guiInfo.CodecName); - nfree(guiInfo.AudioFilename); - nfree(guiInfo.SubtitleFilename); + uiUnsetMedia(); } } @@ -303,6 +292,24 @@ } /** + * @brief Unset media information. + */ +void uiUnsetMedia(void) +{ + guiInfo.VideoWidth = 0; + guiInfo.VideoHeight = 0; + guiInfo.AudioChannels = 0; + guiInfo.RunningTime = 0; + guiInfo.Track = 0; + guiInfo.Chapter = 0; + guiInfo.Angle = 0; + + nfree(guiInfo.CodecName); + nfree(guiInfo.AudioFilename); + nfree(guiInfo.SubtitleFilename); +} + +/** * @brief Set file to be played to current playlist entry. */ void uiCurr(void) diff -r 8889d320734f -r 8b3791b648c6 gui/ui/actions.h --- a/gui/ui/actions.h Mon Dec 10 13:54:56 2012 +0000 +++ b/gui/ui/actions.h Mon Dec 10 13:57:53 2012 +0000 @@ -31,5 +31,6 @@ void uiSetFile(char *dir, char *name, int type); void uiState(void); void uiUnsetFile(void); +void uiUnsetMedia(void); #endif /* MPLAYER_GUI_ACTIONS_H */