I've been doing some work with video output callbacks, and everything was fine until I started playing DVDs (well, DVD ISO actually).
The video appeared squashed horizontally which I eventually realised was due to the sample aspect ratio for the DVDs being something other than 1:1 - prior to this every video I played was mp4 or flv or something, and it always looked right so I never considered the SAR.
If I know the SAR I can render the video properly, indeed I have this working hackishly and my DVD ISOs now render with proper scaling.
However... my problem is how to reliably know the correct SAR when I am rendering?
As far as I know the only place the SAR is available is, eventually but not immediately, via libvlc_media_tracks_get. And this is fine, I can deal with that.
But the above is just the background, finally onto my question...
In principle I suppose there could be multiple video tracks. So I'm thinking I should use libvlc_video_get_track to get the current video track identifier, and then use that identifier to get the corresponding video track structure from libvlc_media_tracks_get.
The problem with that idea is there does not seem to be a hard link between that current video track identifier and the id field in the structures returned by libvlc_media_tracks_get. Indeed, in the case of DVD the libvlc_video_get_track returns 224, but 224 is nowhere to be found in the track data returned by libvlc_media_tracks_get.
I can't just assume and get always get the first video track and use the SAR from that, since other media may well multiple video tracks presumably with different SAR.
So how am I supposed to reliably, for all media types, find the correct SAR to use to render the video, for the currently selected video track, using these callbacks?