mirror of https://git.ffmpeg.org/ffmpeg.git
matroskadec: fix display_width/height = 0 handling
Fixes Ticket2424 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
36babfdc39
commit
f51ce34e5e
|
@ -321,8 +321,8 @@ static EbmlSyntax matroska_info[] = {
|
|||
|
||||
static EbmlSyntax matroska_track_video[] = {
|
||||
{ MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT,0, offsetof(MatroskaTrackVideo,frame_rate) },
|
||||
{ MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_width) },
|
||||
{ MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_height) },
|
||||
{ MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_width), {.u=-1} },
|
||||
{ MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_height), {.u=-1} },
|
||||
{ MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_width) },
|
||||
{ MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_height) },
|
||||
{ MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo,color_space) },
|
||||
|
@ -1576,9 +1576,9 @@ static int matroska_read_header(AVFormatContext *s)
|
|||
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
|
||||
if (!track->default_duration && track->video.frame_rate > 0)
|
||||
track->default_duration = 1000000000/track->video.frame_rate;
|
||||
if (!track->video.display_width)
|
||||
if (track->video.display_width == -1)
|
||||
track->video.display_width = track->video.pixel_width;
|
||||
if (!track->video.display_height)
|
||||
if (track->video.display_height == -1)
|
||||
track->video.display_height = track->video.pixel_height;
|
||||
if (track->video.color_space.size == 4)
|
||||
fourcc = AV_RL32(track->video.color_space.data);
|
||||
|
|
Loading…
Reference in New Issue