Fixes Trac ticket #8757
Unified · Split
| @@ -243,6 +243,23 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) · 242 unmodified lines | |||
| 243 | st->nb_frames = avs->vi->num_frames; | 243 | st->nb_frames = avs->vi->num_frames; |
| 244 | avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator); | 244 | avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator); |
| 245 | 245 | ||
| 246 | av_log(s, AV_LOG_TRACE, "avs_is_field_based: %d\n", avs_is_field_based(avs->vi)); | ||
| 247 | av_log(s, AV_LOG_TRACE, "avs_is_parity_known: %d\n", avs_is_parity_known(avs->vi)); | ||
| 248 | |||
| 249 | /* The following typically only works when assumetff (-bff) and | ||
| 250 | * assumefieldbased is used in-script. Additional | ||
| 251 | * logic using GetParity() could deliver more accurate results | ||
| 252 | * but also decodes a frame which we want to avoid. */ | ||
| 253 | st->codecpar->field_order = AV_FIELD_UNKNOWN; | ||
| 254 | if (avs_is_field_based(avs->vi)) { | ||
| 255 | if (avs_is_tff(avs->vi)) { | ||
| 256 | st->codecpar->field_order = AV_FIELD_TT; | ||
| 257 | } | ||
| 258 | else if (avs_is_bff(avs->vi)) { | ||
| 259 | st->codecpar->field_order = AV_FIELD_BB; | ||
| 260 | } | ||
| 261 | } | ||
| 262 | |||
| 246 | switch (avs->vi->pixel_type) { | 263 | switch (avs->vi->pixel_type) { |
| 247 | /* 10~16-bit YUV pix_fmts (AviSynth+) */ | 264 | /* 10~16-bit YUV pix_fmts (AviSynth+) */ |
| 248 | case AVS_CS_YUV444P10: | 265 | case AVS_CS_YUV444P10: |