# HG changeset patch # User ib # Date 1354543483 0 # Node ID 8ac7761bcb7c188d818fd496df10eb4e36334208 # Parent 0477dcdcd6d69dfbbacab85ab95b6cd0aa0d887c Clear information associated with a file when setting a new one. This fixes showing wrong information when jumping through the playlist tracks in stop mode. diff -r 0477dcdcd6d6 -r 8ac7761bcb7c gui/ui/actions.c --- a/gui/ui/actions.c Mon Dec 03 11:50:59 2012 +0000 +++ b/gui/ui/actions.c Mon Dec 03 14:04:43 2012 +0000 @@ -265,6 +265,8 @@ * @param dir directory (optional, else NULL) * @param name filename * @param type stream type of the file + * + * @note All #guiInfo members associated with the file will be cleared. */ void uiSetFile(char *dir, char *name, int type) { @@ -275,31 +277,29 @@ filename = guiInfo.Filename; - if (type != SAME_STREAMTYPE) + if (type != SAME_STREAMTYPE) { guiInfo.StreamType = type; - nfree(guiInfo.AudioFilename); - nfree(guiInfo.SubtitleFilename); + 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 Unset the file being played. - * - * @note Additionally, clear all #guiInfo members associated with the file. */ void uiUnsetFile(void) { uiSetFile(NULL, NULL, STREAMTYPE_DUMMY); - - nfree(guiInfo.CodecName); - - guiInfo.Track = 0; - guiInfo.Chapter = 0; - guiInfo.Angle = 0; - guiInfo.RunningTime = 0; - guiInfo.AudioChannels = 0; - guiInfo.VideoWidth = 0; - guiInfo.VideoHeight = 0; } /** diff -r 0477dcdcd6d6 -r 8ac7761bcb7c gui/ui/gtk/playlist.c --- a/gui/ui/gtk/playlist.c Mon Dec 03 11:50:59 2012 +0000 +++ b/gui/ui/gtk/playlist.c Mon Dec 03 14:04:43 2012 +0000 @@ -231,7 +231,6 @@ } if ( item ) { - uiUnsetFile(); uiSetFile( item->path,item->name,STREAMTYPE_FILE ); guiInfo.NewPlay = GUI_FILE_NEW; guiInfo.PlaylistNext = (curr.name ? 0 : 1);