[osg-users] [osgPlugins] iOS/OSX: avfoundation plugin not reporting correct media duration

Robert Osfield robert.osfield at gmail.com
Fri Jan 19 01:05:36 PST 2018


HI Alessandro,

Has AVFoundation changed?  Or do you think that the original code was
likely wrong all along?

If there is chance that different versions work slightly different
then making your suggested change could break older versions so we
might need to put some version handling around it.

Robert.

On 19 January 2018 at 08:50, Alessandro Terenzi <a.terenzi at gmail.com> wrote:
> Hi,
> I found out that when you want to know the duration of a media file, specifically a movie, the instruction:
>
>
> Code:
> _videoDuration = CMTimeGetSeconds([_data->avplayer.currentItem duration]);
>
>
>
> returns 0, I tried to use the following instead:
>
>
> Code:
> _videoDuration = CMTimeGetSeconds([[_data->avplayer.currentItem asset] duration]);
>
>
>
> that seems to return the correct movie's duration in seconds.
>
> If you agree I will send a pull request about this fix.
>
> Cheers,
> Alessandro
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72784#72784
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list