diff -Nuarp vlc-3.0.21.orig/modules/codec/avcodec/audio.c vlc-3.0.21/modules/codec/avcodec/audio.c
|
old
|
new
|
|
| 44 | 44 | #include <libavutil/channel_layout.h> |
| 45 | 45 | |
| 46 | 46 | |
| | 47 | #if ! LIBAVCODEC_VERSION_CHECK(61, 33, 102) // Compatibility for profiles <= FFMPEG 8 |
| | 48 | # define AV_PROFILE_UNKNOWN FF_PROFILE_UNKNOWN |
| | 49 | # define AV_LEVEL_UNKNOWN FF_LEVEL_UNKNOWN |
| | 50 | # define AV_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE |
| | 51 | #endif |
| | 52 | |
| 47 | 53 | /***************************************************************************** |
| 48 | 54 | * decoder_sys_t : decoder descriptor |
| 49 | 55 | *****************************************************************************/ |
| … |
… |
static void InitDecoderConfig( decoder_t
|
| 101 | 107 | if( i_size > 0 ) |
| 102 | 108 | { |
| 103 | 109 | p_context->extradata = |
| 104 | | av_malloc( i_size + FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 110 | av_malloc( i_size + AV_INPUT_BUFFER_PADDING_SIZE ); |
| 105 | 111 | if( p_context->extradata ) |
| 106 | 112 | { |
| 107 | 113 | uint8_t *p_dst = p_context->extradata; |
| … |
… |
static void InitDecoderConfig( decoder_t
|
| 109 | 115 | p_context->extradata_size = i_size; |
| 110 | 116 | |
| 111 | 117 | memcpy( &p_dst[0], &p_src[i_offset], i_size ); |
| 112 | | memset( &p_dst[i_size], 0, FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 118 | memset( &p_dst[i_size], 0, AV_INPUT_BUFFER_PADDING_SIZE ); |
| 113 | 119 | } |
| 114 | 120 | } |
| 115 | 121 | } |
| … |
… |
int InitAudioDec( vlc_object_t *obj )
|
| 266 | 272 | p_dec->pf_flush = Flush; |
| 267 | 273 | |
| 268 | 274 | /* XXX: Writing input format makes little sense. */ |
| 269 | | if( avctx->profile != FF_PROFILE_UNKNOWN ) |
| | 275 | if( avctx->profile != AV_PROFILE_UNKNOWN ) |
| 270 | 276 | p_dec->fmt_in.i_profile = avctx->profile; |
| 271 | | if( avctx->level != FF_LEVEL_UNKNOWN ) |
| | 277 | if( avctx->level != AV_LEVEL_UNKNOWN ) |
| 272 | 278 | p_dec->fmt_in.i_level = avctx->level; |
| 273 | 279 | |
| 274 | 280 | return VLC_SUCCESS; |
| … |
… |
static int DecodeBlock( decoder_t *p_dec
|
| 348 | 354 | |
| 349 | 355 | if( (p_block->i_flags & BLOCK_FLAG_PRIVATE_REALLOCATED) == 0 ) |
| 350 | 356 | { |
| 351 | | *pp_block = p_block = block_Realloc( p_block, 0, p_block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 357 | *pp_block = p_block = block_Realloc( p_block, 0, p_block->i_buffer + AV_INPUT_BUFFER_PADDING_SIZE ); |
| 352 | 358 | if( !p_block ) |
| 353 | 359 | goto end; |
| 354 | | p_block->i_buffer -= FF_INPUT_BUFFER_PADDING_SIZE; |
| 355 | | memset( &p_block->p_buffer[p_block->i_buffer], 0, FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 360 | p_block->i_buffer -= AV_INPUT_BUFFER_PADDING_SIZE; |
| | 361 | memset( &p_block->p_buffer[p_block->i_buffer], 0, AV_INPUT_BUFFER_PADDING_SIZE ); |
| 356 | 362 | |
| 357 | 363 | p_block->i_flags |= BLOCK_FLAG_PRIVATE_REALLOCATED; |
| 358 | 364 | } |
diff -Nuarp vlc-3.0.21.orig/modules/codec/avcodec/avcommon_compat.h vlc-3.0.21/modules/codec/avcodec/avcommon_compat.h
|
old
|
new
|
|
| 53 | 53 | #ifndef AV_CODEC_FLAG2_FAST |
| 54 | 54 | # define AV_CODEC_FLAG2_FAST CODEC_FLAG2_FAST |
| 55 | 55 | #endif |
| 56 | | #ifndef FF_INPUT_BUFFER_PADDING_SIZE |
| 57 | | # define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE |
| | 56 | #if ! LIBAVCODEC_VERSION_CHECK(61, 33, 102) // Compatibility for profiles <= FFMPEG 8 |
| | 57 | # ifndef FF_INPUT_BUFFER_PADDING_SIZE |
| | 58 | # define FF_INPUT_BUFFER_PADDING_SIZE 64 |
| | 59 | # endif |
| | 60 | #define AV_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE |
| 58 | 61 | #endif |
| 59 | 62 | #ifndef AV_CODEC_FLAG_INTERLACED_DCT |
| 60 | 63 | # define AV_CODEC_FLAG_INTERLACED_DCT CODEC_FLAG_INTERLACED_DCT |
| … |
… |
|
| 72 | 75 | # define AV_CODEC_CAP_SMALL_LAST_FRAME CODEC_CAP_SMALL_LAST_FRAME |
| 73 | 76 | #endif |
| 74 | 77 | #ifndef AV_INPUT_BUFFER_MIN_SIZE |
| 75 | | # define AV_INPUT_BUFFER_MIN_SIZE FF_MIN_BUFFER_SIZE |
| | 78 | # ifdef FF_MIN_BUFFER_SIZE |
| | 79 | # define AV_INPUT_BUFFER_MIN_SIZE FF_MIN_BUFFER_SIZE |
| | 80 | # else |
| | 81 | # define AV_INPUT_BUFFER_MIN_SIZE 16384 // removed with ffmpeg 8 |
| | 82 | # endif |
| 76 | 83 | #endif |
| 77 | 84 | #ifndef FF_MAX_B_FRAMES |
| 78 | 85 | # define FF_MAX_B_FRAMES 16 // FIXME: remove this |
diff -Nuarp vlc-3.0.21.orig/modules/codec/avcodec/encoder.c vlc-3.0.21/modules/codec/avcodec/encoder.c
|
old
|
new
|
|
| 65 | 65 | # define AVC_MAYBE_CONST |
| 66 | 66 | #endif |
| 67 | 67 | |
| | 68 | #if ! LIBAVCODEC_VERSION_CHECK(61, 33, 102) // Compatibility for profiles <= FFMPEG 8 |
| | 69 | # define AV_PROFILE_AAC_MAIN FF_PROFILE_AAC_MAIN |
| | 70 | # define AV_PROFILE_AAC_LOW FF_PROFILE_AAC_LOW |
| | 71 | # define AV_PROFILE_AAC_SSR FF_PROFILE_AAC_SSR |
| | 72 | # define AV_PROFILE_AAC_LTP FF_PROFILE_AAC_LTP |
| | 73 | # define AV_PROFILE_AAC_HE_V2 FF_PROFILE_AAC_HE_V2 |
| | 74 | # define AV_PROFILE_AAC_HE FF_PROFILE_AAC_HE |
| | 75 | # define AV_PROFILE_AAC_LD FF_PROFILE_AAC_LD |
| | 76 | # define AV_PROFILE_AAC_ELD FF_PROFILE_AAC_ELD |
| | 77 | #endif |
| | 78 | |
| 68 | 79 | /***************************************************************************** |
| 69 | 80 | * Local prototypes |
| 70 | 81 | *****************************************************************************/ |
| … |
… |
int InitVideoEnc( vlc_object_t *p_this )
|
| 468 | 479 | psz_val = var_GetString( p_enc, ENC_CFG_PREFIX "aac-profile" ); |
| 469 | 480 | /* libavcodec uses faac encoder atm, and it has issues with |
| 470 | 481 | * other than low-complexity profile, so default to that */ |
| 471 | | p_sys->i_aac_profile = FF_PROFILE_AAC_LOW; |
| | 482 | p_sys->i_aac_profile = AV_PROFILE_AAC_LOW; |
| 472 | 483 | if( psz_val && *psz_val ) |
| 473 | 484 | { |
| 474 | 485 | if( !strncmp( psz_val, "main", 4 ) ) |
| 475 | | p_sys->i_aac_profile = FF_PROFILE_AAC_MAIN; |
| | 486 | p_sys->i_aac_profile = AV_PROFILE_AAC_MAIN; |
| 476 | 487 | else if( !strncmp( psz_val, "low", 3 ) ) |
| 477 | | p_sys->i_aac_profile = FF_PROFILE_AAC_LOW; |
| | 488 | p_sys->i_aac_profile = AV_PROFILE_AAC_LOW; |
| 478 | 489 | else if( !strncmp( psz_val, "ssr", 3 ) ) |
| 479 | | p_sys->i_aac_profile = FF_PROFILE_AAC_SSR; |
| | 490 | p_sys->i_aac_profile = AV_PROFILE_AAC_SSR; |
| 480 | 491 | else if( !strncmp( psz_val, "ltp", 3 ) ) |
| 481 | | p_sys->i_aac_profile = FF_PROFILE_AAC_LTP; |
| | 492 | p_sys->i_aac_profile = AV_PROFILE_AAC_LTP; |
| 482 | 493 | /* These require libavcodec with libfdk-aac */ |
| 483 | 494 | else if( !strncmp( psz_val, "hev2", 4 ) ) |
| 484 | | p_sys->i_aac_profile = FF_PROFILE_AAC_HE_V2; |
| | 495 | p_sys->i_aac_profile = AV_PROFILE_AAC_HE_V2; |
| 485 | 496 | else if( !strncmp( psz_val, "hev1", 4 ) ) |
| 486 | | p_sys->i_aac_profile = FF_PROFILE_AAC_HE; |
| | 497 | p_sys->i_aac_profile = AV_PROFILE_AAC_HE; |
| 487 | 498 | else if( !strncmp( psz_val, "ld", 2 ) ) |
| 488 | | p_sys->i_aac_profile = FF_PROFILE_AAC_LD; |
| | 499 | p_sys->i_aac_profile = AV_PROFILE_AAC_LD; |
| 489 | 500 | else if( !strncmp( psz_val, "eld", 3 ) ) |
| 490 | | p_sys->i_aac_profile = FF_PROFILE_AAC_ELD; |
| | 501 | p_sys->i_aac_profile = AV_PROFILE_AAC_ELD; |
| 491 | 502 | else |
| 492 | 503 | { |
| 493 | 504 | msg_Warn( p_enc, "unknown AAC profile requested, setting it to low" ); |
| 494 | | p_sys->i_aac_profile = FF_PROFILE_AAC_LOW; |
| | 505 | p_sys->i_aac_profile = AV_PROFILE_AAC_LOW; |
| 495 | 506 | } |
| 496 | 507 | } |
| 497 | 508 | free( psz_val ); |
| … |
… |
static block_t *EncodeVideo( encoder_t *
|
| 1217 | 1228 | frame->pict_type = 0; |
| 1218 | 1229 | |
| 1219 | 1230 | frame->repeat_pict = p_pict->i_nb_fields - 2; |
| | 1231 | #if LIBAVUTIL_VERSION_CHECK( 58, 7, 100 ) |
| | 1232 | if (p_pict->b_progressive) |
| | 1233 | frame->flags &= ~AV_FRAME_FLAG_INTERLACED; |
| | 1234 | else |
| | 1235 | frame->flags |= AV_FRAME_FLAG_INTERLACED; |
| | 1236 | if (p_pict->b_top_field_first) |
| | 1237 | frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST; |
| | 1238 | else |
| | 1239 | frame->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST; |
| | 1240 | #else |
| 1220 | 1241 | frame->interlaced_frame = !p_pict->b_progressive; |
| 1221 | 1242 | frame->top_field_first = !!p_pict->b_top_field_first; |
| | 1243 | #endif |
| 1222 | 1244 | |
| 1223 | 1245 | frame->format = p_sys->p_context->pix_fmt; |
| 1224 | 1246 | frame->width = p_sys->p_context->width; |
| … |
… |
void EndVideoEnc( vlc_object_t *p_this )
|
| 1473 | 1495 | av_frame_free( &p_sys->frame ); |
| 1474 | 1496 | |
| 1475 | 1497 | vlc_avcodec_lock(); |
| 1476 | | avcodec_close( p_sys->p_context ); |
| 1477 | | vlc_avcodec_unlock(); |
| 1478 | 1498 | avcodec_free_context( &p_sys->p_context ); |
| | 1499 | vlc_avcodec_unlock(); |
| 1479 | 1500 | |
| 1480 | 1501 | |
| 1481 | 1502 | av_free( p_sys->p_interleave_buf ); |
diff -Nuarp vlc-3.0.21.orig/modules/codec/avcodec/subtitle.c vlc-3.0.21/modules/codec/avcodec/subtitle.c
|
old
|
new
|
static subpicture_t *DecodeBlock(decoder
|
| 174 | 174 | *block_ptr = |
| 175 | 175 | block = block_Realloc(block, |
| 176 | 176 | 0, |
| 177 | | block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE); |
| | 177 | block->i_buffer + AV_INPUT_BUFFER_PADDING_SIZE); |
| 178 | 178 | if (!block) |
| 179 | 179 | return NULL; |
| 180 | | block->i_buffer -= FF_INPUT_BUFFER_PADDING_SIZE; |
| 181 | | memset(&block->p_buffer[block->i_buffer], 0, FF_INPUT_BUFFER_PADDING_SIZE); |
| | 180 | block->i_buffer -= AV_INPUT_BUFFER_PADDING_SIZE; |
| | 181 | memset(&block->p_buffer[block->i_buffer], 0, AV_INPUT_BUFFER_PADDING_SIZE); |
| 182 | 182 | |
| 183 | 183 | /* */ |
| 184 | 184 | AVSubtitle subtitle; |
diff -Nuarp vlc-3.0.21.orig/modules/codec/avcodec/vaapi.c vlc-3.0.21/modules/codec/avcodec/vaapi.c
|
old
|
new
|
static int GetVaProfile(AVCodecContext *
|
| 87 | 87 | count = 18; |
| 88 | 88 | break; |
| 89 | 89 | case AV_CODEC_ID_HEVC: |
| 90 | | if (ctx->profile == FF_PROFILE_HEVC_MAIN) |
| | 90 | if (ctx->profile == AV_PROFILE_HEVC_MAIN) |
| 91 | 91 | i_profile = VAProfileHEVCMain; |
| 92 | | else if (ctx->profile == FF_PROFILE_HEVC_MAIN_10) |
| | 92 | else if (ctx->profile == AV_PROFILE_HEVC_MAIN_10) |
| 93 | 93 | { |
| 94 | 94 | i_profile = VAProfileHEVCMain10; |
| 95 | 95 | i_vlc_chroma = VLC_CODEC_VAAPI_420_10BPP; |
| … |
… |
static int GetVaProfile(AVCodecContext *
|
| 103 | 103 | count = 5; |
| 104 | 104 | break; |
| 105 | 105 | case AV_CODEC_ID_VP9: |
| 106 | | if (ctx->profile == FF_PROFILE_VP9_0) |
| | 106 | if (ctx->profile == AV_PROFILE_VP9_0) |
| 107 | 107 | i_profile = VAProfileVP9Profile0; |
| 108 | 108 | #if VA_CHECK_VERSION( 0, 39, 0 ) |
| 109 | | else if (ctx->profile == FF_PROFILE_VP9_2) |
| | 109 | else if (ctx->profile == AV_PROFILE_VP9_2) |
| 110 | 110 | { |
| 111 | 111 | i_profile = VAProfileVP9Profile2; |
| 112 | 112 | i_vlc_chroma = VLC_CODEC_VAAPI_420_10BPP; |
diff -Nuarp vlc-3.0.21.orig/modules/codec/avcodec/video.c vlc-3.0.21/modules/codec/avcodec/video.c
|
old
|
new
|
|
| 50 | 50 | #include "../../packetizer/av1.h" |
| 51 | 51 | #include "../codec/cc.h" |
| 52 | 52 | |
| | 53 | #if ! LIBAVCODEC_VERSION_CHECK(61, 33, 102) // Compatibility for profiles <= FFMPEG 8 |
| | 54 | # define AV_PROFILE_UNKNOWN FF_PROFILE_UNKNOWN |
| | 55 | # define AV_LEVEL_UNKNOWN FF_LEVEL_UNKNOWN |
| | 56 | # define AV_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE |
| | 57 | #endif |
| | 58 | |
| | 59 | |
| 53 | 60 | /***************************************************************************** |
| 54 | 61 | * decoder_sys_t : decoder descriptor |
| 55 | 62 | *****************************************************************************/ |
| … |
… |
static int lavc_GetVideoFormat(decoder_t
|
| 200 | 207 | else if (ctx->time_base.num > 0 && ctx->time_base.den > 0) |
| 201 | 208 | { |
| 202 | 209 | fmt->i_frame_rate = ctx->time_base.den; |
| 203 | | fmt->i_frame_rate_base = ctx->time_base.num |
| 204 | | * __MAX(ctx->ticks_per_frame, 1); |
| | 210 | fmt->i_frame_rate_base = ctx->time_base.num; |
| 205 | 211 | } |
| 206 | 212 | |
| 207 | 213 | /* FIXME we should only set the known values and let the core decide |
| … |
… |
static int lavc_UpdateVideoFormat(decode
|
| 323 | 329 | |
| 324 | 330 | /* always have date in fields/ticks units */ |
| 325 | 331 | if(dec->p_sys->pts.i_divider_num) |
| 326 | | date_Change(&dec->p_sys->pts, fmt_out.i_frame_rate * |
| 327 | | __MAX(ctx->ticks_per_frame, 1), |
| | 332 | date_Change(&dec->p_sys->pts, fmt_out.i_frame_rate, |
| 328 | 333 | fmt_out.i_frame_rate_base); |
| 329 | 334 | else |
| 330 | | date_Init(&dec->p_sys->pts, fmt_out.i_frame_rate * |
| 331 | | __MAX(ctx->ticks_per_frame, 1), |
| | 335 | date_Init(&dec->p_sys->pts, fmt_out.i_frame_rate, |
| 332 | 336 | fmt_out.i_frame_rate_base); |
| 333 | 337 | |
| 334 | 338 | fmt_out.p_palette = dec->fmt_out.video.p_palette; |
| … |
… |
static int InitVideoDecCommon( decoder_t
|
| 622 | 626 | p_dec->pf_flush = Flush; |
| 623 | 627 | |
| 624 | 628 | /* XXX: Writing input format makes little sense. */ |
| 625 | | if( p_context->profile != FF_PROFILE_UNKNOWN ) |
| | 629 | if( p_context->profile != AV_PROFILE_UNKNOWN ) |
| 626 | 630 | p_dec->fmt_in.i_profile = p_context->profile; |
| 627 | | if( p_context->level != FF_LEVEL_UNKNOWN ) |
| | 631 | if( p_context->level != AV_LEVEL_UNKNOWN ) |
| 628 | 632 | p_dec->fmt_in.i_level = p_context->level; |
| 629 | 633 | return VLC_SUCCESS; |
| 630 | 634 | } |
| … |
… |
static vlc_tick_t interpolate_next_pts(
|
| 937 | 941 | p_sys->pts.i_divider_num == 0 ) |
| 938 | 942 | return VLC_TICK_INVALID; |
| 939 | 943 | |
| | 944 | #if LIBAVCODEC_VERSION_CHECK( 60, 12, 100 ) |
| | 945 | int i_tick = p_context->codec_descriptor->props & AV_CODEC_PROP_FIELDS ? 2 : 1; |
| | 946 | #else |
| 940 | 947 | int i_tick = p_context->ticks_per_frame; |
| 941 | | if( i_tick <= 0 ) |
| 942 | | i_tick = 1; |
| | 948 | #endif |
| 943 | 949 | |
| 944 | 950 | /* interpolate the next PTS */ |
| 945 | 951 | return date_Increment( &p_sys->pts, i_tick + frame->repeat_pict ); |
| … |
… |
static picture_t *DecodeBlock( decoder_t
|
| 1179 | 1185 | eos_spotted = ( p_block->i_flags & BLOCK_FLAG_END_OF_SEQUENCE ) != 0; |
| 1180 | 1186 | |
| 1181 | 1187 | p_block = block_Realloc( p_block, 0, |
| 1182 | | p_block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 1188 | p_block->i_buffer + AV_INPUT_BUFFER_PADDING_SIZE ); |
| 1183 | 1189 | if( !p_block ) |
| 1184 | 1190 | return NULL; |
| 1185 | | p_block->i_buffer -= FF_INPUT_BUFFER_PADDING_SIZE; |
| | 1191 | p_block->i_buffer -= AV_INPUT_BUFFER_PADDING_SIZE; |
| 1186 | 1192 | *pp_block = p_block; |
| 1187 | 1193 | memset( p_block->p_buffer + p_block->i_buffer, 0, |
| 1188 | | FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 1194 | AV_INPUT_BUFFER_PADDING_SIZE ); |
| 1189 | 1195 | } |
| 1190 | 1196 | |
| 1191 | 1197 | do |
| … |
… |
static picture_t *DecodeBlock( decoder_t
|
| 1414 | 1420 | /* Hack to force display of still pictures */ |
| 1415 | 1421 | p_pic->b_force = p_sys->b_first_frame; |
| 1416 | 1422 | p_pic->i_nb_fields = 2 + frame->repeat_pict; |
| | 1423 | #if LIBAVUTIL_VERSION_CHECK( 58, 7, 100 ) |
| | 1424 | p_pic->b_progressive = !(frame->flags & AV_FRAME_FLAG_INTERLACED); |
| | 1425 | p_pic->b_top_field_first = !!(frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST); |
| | 1426 | #else |
| 1417 | 1427 | p_pic->b_progressive = !frame->interlaced_frame; |
| 1418 | 1428 | p_pic->b_top_field_first = frame->top_field_first; |
| | 1429 | #endif |
| 1419 | 1430 | |
| 1420 | 1431 | if (DecodeSidedata(p_dec, frame, p_pic)) |
| 1421 | 1432 | i_pts = VLC_TICK_INVALID; |
| … |
… |
static void ffmpeg_InitCodec( decoder_t
|
| 1502 | 1513 | p_sys->p_context->extradata_size = i_size + 12; |
| 1503 | 1514 | p = p_sys->p_context->extradata = |
| 1504 | 1515 | av_malloc( p_sys->p_context->extradata_size + |
| 1505 | | FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 1516 | AV_INPUT_BUFFER_PADDING_SIZE ); |
| 1506 | 1517 | if( !p ) |
| 1507 | 1518 | return; |
| 1508 | 1519 | |
| … |
… |
static void ffmpeg_InitCodec( decoder_t
|
| 1539 | 1550 | { |
| 1540 | 1551 | p_sys->p_context->extradata_size = i_size; |
| 1541 | 1552 | p_sys->p_context->extradata = |
| 1542 | | av_malloc( i_size + FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 1553 | av_malloc( i_size + AV_INPUT_BUFFER_PADDING_SIZE ); |
| 1543 | 1554 | if( p_sys->p_context->extradata ) |
| 1544 | 1555 | { |
| 1545 | 1556 | memcpy( p_sys->p_context->extradata, |
| 1546 | 1557 | p_dec->fmt_in.p_extra, i_size ); |
| 1547 | 1558 | memset( p_sys->p_context->extradata + i_size, |
| 1548 | | 0, FF_INPUT_BUFFER_PADDING_SIZE ); |
| | 1559 | 0, AV_INPUT_BUFFER_PADDING_SIZE ); |
| 1549 | 1560 | } |
| 1550 | 1561 | } |
| 1551 | 1562 | } |
diff -Nuarp vlc-3.0.21.orig/modules/demux/avformat/demux.c vlc-3.0.21/modules/demux/avformat/demux.c
|
old
|
new
|
static vlc_fourcc_t CodecTagToFourcc( ui
|
| 112 | 112 | #endif |
| 113 | 113 | } |
| 114 | 114 | |
| | 115 | static inline void* GetStreamSideData(const AVStream *s, enum AVPacketSideDataType type) |
| | 116 | { |
| | 117 | #if LIBAVCODEC_VERSION_CHECK( 60, 29, 100 ) |
| | 118 | const AVCodecParameters *cp = s->codecpar; |
| | 119 | const AVPacketSideData *psd = |
| | 120 | av_packet_side_data_get(cp->coded_side_data, cp->nb_coded_side_data, type); |
| | 121 | return psd ? psd->data : NULL; |
| | 122 | #else |
| | 123 | return av_stream_get_side_data(s, type, NULL); |
| | 124 | #endif |
| | 125 | } |
| | 126 | |
| 115 | 127 | /***************************************************************************** |
| 116 | 128 | * Open |
| 117 | 129 | *****************************************************************************/ |
| … |
… |
static void get_rotation(es_format_t *fm
|
| 138 | 150 | else |
| 139 | 151 | fmt->video.orientation = ORIENT_NORMAL; |
| 140 | 152 | } |
| 141 | | int32_t *matrix = (int32_t *)av_stream_get_side_data(s, AV_PKT_DATA_DISPLAYMATRIX, NULL); |
| | 153 | |
| | 154 | int32_t *matrix = GetStreamSideData(s, AV_PKT_DATA_DISPLAYMATRIX); |
| 142 | 155 | if( matrix ) { |
| 143 | 156 | angle = lround(av_display_rotation_get(matrix)); |
| 144 | 157 | |