EricBerendsen / dvbinspector

DVB Inspector is an open-source DVB analyzer, written in java
http://www.digitalekabeltelevisie.nl/dvb_inspector/
GNU General Public License v3.0
184 stars 31 forks source link

Fix millisecond padding in getPacketShortTime #67

Closed davemevans closed 10 months ago

davemevans commented 10 months ago

In BitrateView, packets with a time with millisecond count of less than 100 are displayed incorrectly. Fixed this by formatting as elsewhere (ie padding to 3dp). I appreciate that, at least at some point in the past, this method was supposed to return a shortened timestamp, but to me it's still confusing to display milliseconds in this way.

Given the method name, it wasn't clear to me why one branch of the if uses fully padded time format and the other uses a shortened version. In the end I figured the full version was correct and so rationalised the two branches to improve reuse - please let me know if I misunderstood the intention and I can just pad the milliseconds. Or in fact if I have missed the point entirely :smile:

Thanks for DVBInspector - it's a great tool I've used for years (and even contributed some bits about ten years ago :sweat_smile:)

image

EricBerendsen commented 10 months ago

Hi Dave, thank you very much for this fix. Yes, the code was real messy, your interpretation is correct and the fix made it more readable.