History

mpeg2_metadata, cbs_mpeg2: Fix handling of colour_description

If a sequence display extension is read with colour_description equal to zero, but a user wants to add one or more of the colour_description elements, then the colour_description elements the user did not explicitly request to be set are set to zero and not to the value equal to unknown/unspecified (namely 2). A value of zero is not only inappropriate, but explicitly forbidden. This is fixed by inferring the right default values during the reading process if the elements are absent; moreover, changing any of the colour_description elements to zero is now no longer possible.

Andreas Rheinhardt committed 7 years ago

Commit c2a91641 parent 47b6ca03 files · +31 −0Browse files

Showing the changes to libavcodec/cbs_mpeg2_syntax_template.c (1 of 3 files). Show all

Unified · Split

libavcodec/cbs_mpeg2_syntax_template.c+4−0
@@ -144,6 +144,10 @@ static int FUNC(sequence_display_extension)(CodedBitstreamContext *ctx, RWContex · 143 unmodified lines
144 uir(8, transfer_characteristics);144 uir(8, transfer_characteristics);
145 uir(8, matrix_coefficients);145 uir(8, matrix_coefficients);
146#endif146#endif
147 } else {
148 infer(colour_primaries, 2);
149 infer(transfer_characteristics, 2);
150 infer(matrix_coefficients, 2);
147 }151 }
148 152
149 ui(14, display_horizontal_size);153 ui(14, display_horizontal_size);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t