+
+ if (_video_stream) {
+ /* This code taken from get_rotation() in ffmpeg:cmdutils.c */
+ AVStream* stream = _format_context->streams[*_video_stream];
+ AVDictionaryEntry* rotate_tag = av_dict_get (stream->metadata, "rotate", 0, 0);
+ uint8_t* displaymatrix = av_stream_get_side_data (stream, AV_PKT_DATA_DISPLAYMATRIX, 0);
+ _rotation = 0;
+
+ if (rotate_tag && *rotate_tag->value && strcmp(rotate_tag->value, "0")) {
+ char *tail;
+ _rotation = av_strtod (rotate_tag->value, &tail);
+ if (*tail) {
+ _rotation = 0;
+ }
+ }
+
+ if (displaymatrix && !_rotation) {
+ _rotation = - av_display_rotation_get ((int32_t*) displaymatrix);
+ }
+
+ _rotation = *_rotation - 360 * floor (*_rotation / 360 + 0.9 / 360);
+
+ DCPOMATIC_ASSERT (fabs (*_rotation - 90 * round (*_rotation / 90)) < 2);
+ }
+
+ LOG_GENERAL("Temporal reference was %1", temporal_reference);
+ if (temporal_reference.find("T2T3B2B3T2T3B2B3") != string::npos || temporal_reference.find("B2B3T2T3B2B3T2T3") != string::npos) {
+ /* The magical sequence (taken from mediainfo) suggests that 2:3 pull-down is in use */
+ _pulldown = true;
+ LOG_GENERAL_NC("Suggest that this may be 2:3 pull-down (soft telecine)");
+ }
+
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+ AVDictionaryEntry* e = av_dict_get (_format_context->metadata, SWAROOP_ID_TAG, 0, 0);
+ if (e) {
+ _id = e->value;
+ }
+#endif