Skip to content

Commit

Permalink
Fix _PictType frame prop when libvpx-vp9 is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Asd-g committed Mar 29, 2024
1 parent 3bbe176 commit a316f08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions AviSynth/video_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,8 @@ void avs_set_frame_properties
env->propSetInt(props, "_DurationNum", duration_num, 0);
env->propSetInt(props, "_DurationDen", duration_den, 0);
if (stream)
env->propSetFloat(props, "_AbsoluteTime", ((stream->start_time != AV_NOPTS_VALUE) ? (static_cast<double>(stream->start_time) / stream->time_base.den * stream->time_base.num) : 0.0)
env->propSetFloat(props, "_AbsoluteTime", ((stream->start_time != AV_NOPTS_VALUE) ?
(static_cast<double>(stream->start_time) / stream->time_base.den * stream->time_base.num) : 0.0)
+ static_cast<double>(n * duration_num) / duration_den, 0);
else
env->propSetFloat(props, "_AbsoluteTime", static_cast<double>(n * duration_num) / duration_den, 0);
Expand All @@ -883,7 +884,8 @@ void avs_set_frame_properties
env->propSetInt(props, "_ChromaLocation", av_frame->chroma_location - 1, 0);
}
/* Picture type */
char pict_type = av_get_picture_type_char(av_frame->pict_type);
char pict_type = (av_frame->pict_type == 80 || av_frame->pict_type == 73) ? av_frame->pict_type
: av_get_picture_type_char(av_frame->pict_type);
env->propSetData(props, "_PictType", &pict_type, 1, 0);
/* BFF or TFF */
int field_based = 0;
Expand Down
3 changes: 2 additions & 1 deletion VapourSynth/video_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,8 @@ void vs_set_frame_properties
vsapi->propSetInt( props, "_ChromaLocation", av_frame->chroma_location - 1, paReplace );
}
/* Picture type */
char pict_type = av_get_picture_type_char( av_frame->pict_type );
char pict_type = (av_frame->pict_type == 80 || av_frame->pict_type == 73) ? av_frame->pict_type
: av_get_picture_type_char(av_frame->pict_type);
vsapi->propSetData( props, "_PictType", &pict_type, 1, paReplace );
/* BFF or TFF */
int field_based = 0;
Expand Down

0 comments on commit a316f08

Please sign in to comment.