|
|
|
@ -352,52 +352,52 @@ static subpicture_t *DecodeSubtitleMessage(decoder_t *dec, |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
|
|
|
|
subpicture_region_t *region = DecodeSimpleBitmap(dec, data, block_length); |
|
|
|
if (!region) |
|
|
|
goto error; |
|
|
|
subpicture_t *sub = decoder_NewSubpicture(dec, NULL); |
|
|
|
if (!sub) { |
|
|
|
subpicture_region_Delete(region); |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
vlc_tick_t frame_duration; |
|
|
|
switch (display_standard) { |
|
|
|
case 0: |
|
|
|
sub->i_original_picture_width = 720; |
|
|
|
sub->i_original_picture_height = 480; |
|
|
|
frame_duration = VLC_TICK_FROM_US(33367); |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
sub->i_original_picture_width = 720; |
|
|
|
sub->i_original_picture_height = 576; |
|
|
|
frame_duration = VLC_TICK_FROM_MS(40); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
sub->i_original_picture_width = 1280; |
|
|
|
sub->i_original_picture_height = 720; |
|
|
|
frame_duration = VLC_TICK_FROM_US(16683); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
sub->i_original_picture_width = 1920; |
|
|
|
sub->i_original_picture_height = 1080; |
|
|
|
frame_duration = VLC_TICK_FROM_US(16683); |
|
|
|
break; |
|
|
|
default: |
|
|
|
msg_Warn(dec, "Unknown display standard"); |
|
|
|
sub->i_original_picture_width = 0; |
|
|
|
sub->i_original_picture_height = 0; |
|
|
|
frame_duration = VLC_TICK_FROM_MS(40); |
|
|
|
break; |
|
|
|
} |
|
|
|
sub->b_absolute = true; |
|
|
|
if (!pre_clear_display) |
|
|
|
msg_Warn(dec, "SCTE-27 subtitles without pre_clear_display flag are not well supported"); |
|
|
|
sub->b_ephemer = true; |
|
|
|
sub->i_start = date; |
|
|
|
sub->i_stop = date + display_duration * frame_duration; |
|
|
|
vlc_spu_regions_push(&sub->regions, region); |
|
|
|
|
|
|
|
return sub; |
|
|
|
subpicture_region_t *region = DecodeSimpleBitmap(dec, data, block_length); |
|
|
|
if (!region) |
|
|
|
goto error; |
|
|
|
subpicture_t *sub = decoder_NewSubpicture(dec, NULL); |
|
|
|
if (!sub) { |
|
|
|
subpicture_region_Delete(region); |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
vlc_tick_t frame_duration; |
|
|
|
switch (display_standard) { |
|
|
|
case 0: |
|
|
|
sub->i_original_picture_width = 720; |
|
|
|
sub->i_original_picture_height = 480; |
|
|
|
frame_duration = VLC_TICK_FROM_US(33367); |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
sub->i_original_picture_width = 720; |
|
|
|
sub->i_original_picture_height = 576; |
|
|
|
frame_duration = VLC_TICK_FROM_MS(40); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
sub->i_original_picture_width = 1280; |
|
|
|
sub->i_original_picture_height = 720; |
|
|
|
frame_duration = VLC_TICK_FROM_US(16683); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
sub->i_original_picture_width = 1920; |
|
|
|
sub->i_original_picture_height = 1080; |
|
|
|
frame_duration = VLC_TICK_FROM_US(16683); |
|
|
|
break; |
|
|
|
default: |
|
|
|
msg_Warn(dec, "Unknown display standard"); |
|
|
|
sub->i_original_picture_width = 0; |
|
|
|
sub->i_original_picture_height = 0; |
|
|
|
frame_duration = VLC_TICK_FROM_MS(40); |
|
|
|
break; |
|
|
|
} |
|
|
|
sub->b_absolute = true; |
|
|
|
if (!pre_clear_display) |
|
|
|
msg_Warn(dec, "SCTE-27 subtitles without pre_clear_display flag are not well supported"); |
|
|
|
sub->b_ephemer = true; |
|
|
|
sub->i_start = date; |
|
|
|
sub->i_stop = date + display_duration * frame_duration; |
|
|
|
vlc_spu_regions_push(&sub->regions, region); |
|
|
|
|
|
|
|
return sub; |
|
|
|
|
|
|
|
error: |
|
|
|
msg_Err(dec, "corrupted subtitle_message"); |
|
|
|
|