mi-info: code cleanups

First reset the info pane and then check/update. This fixes not resetting the
tabs on info==null.
This commit is contained in:
Stefan Sauer 2013-09-09 18:37:24 +02:00
parent e427932626
commit 533702a0ed

View file

@ -355,7 +355,16 @@ public class MediaInfo.Info : Box
// sort streams
ArrayList<string> sids = new ArrayList<string> ();
int six;
int page_offset;
int page_offset = 0;
// reset notebooks
if (compact_mode) {
clear_notebook (all_streams);
} else {
clear_notebook (video_streams);
clear_notebook (audio_streams);
clear_notebook (subtitle_streams);
}
if (info == null) {
container_caps.set_text ("");
@ -390,7 +399,7 @@ public class MediaInfo.Info : Box
debug ("stream[%d:%s]: %s", i, sinfo.get_stream_type_nick(), sinfo.get_caps ().to_string ());
}
*/
// get stream info
// do container streams
sinfo = info.get_stream_info ();
if (sinfo != null) {
caps = sinfo.get_caps ();
@ -401,16 +410,6 @@ public class MediaInfo.Info : Box
// irks: we can also have the toc on a *_stream
}
// reset notebooks
if (compact_mode) {
clear_notebook (all_streams);
} else {
clear_notebook (video_streams);
clear_notebook (audio_streams);
clear_notebook (subtitle_streams);
}
page_offset = 0;
// do video streams
nb = compact_mode ? all_streams : video_streams;
l = info.get_video_streams ();