diff options
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index f890b5d693..e61529fb71 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -38,6 +38,10 @@ #include <libavutil/display.h> #include <libavutil/opt.h> +#if HAVE_AVUTIL_SPHERICAL +#include <libavutil/spherical.h> +#endif + #include "common/msg.h" #include "common/tags.h" #include "common/av_common.h" @@ -641,6 +645,19 @@ static void handle_new_stream(demuxer_t *demuxer, int i) sh->codec->rotate = (((int)(-r) % 360) + 360) % 360; } +#if HAVE_AVUTIL_SPHERICAL + sd = av_stream_get_side_data(st, AV_PKT_DATA_SPHERICAL, NULL); + if (sd) { + AVSphericalMapping *sp = (void *)sd; + struct mp_spherical_params *mpsp = &sh->codec->spherical; + mpsp->type = sp->projection == AV_SPHERICAL_EQUIRECTANGULAR ? + MP_SPHERICAL_EQUIRECTANGULAR : MP_SPHERICAL_UNKNOWN; + mpsp->ref_angles[0] = sp->yaw / (float)(1 << 16); + mpsp->ref_angles[1] = sp->pitch / (float)(1 << 16); + mpsp->ref_angles[2] = sp->roll / (float)(1 << 16); + } +#endif + // This also applies to vfw-muxed mkv, but we can't detect these easily. sh->codec->avi_dts = matches_avinputformat_name(priv, "avi"); |