History

swscale/utils: fix changing src/dst range after initializing the context

Michael Niedermayer committed 12 years ago

Commit 4959a4f1 parent fa988851 file · +6 −0Browse files

Unified · Split

libswscale/utils.c+6−0
@@ -983,6 +983,7 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], · 982 unmodified lines
983{983{
984 const AVPixFmtDescriptor *desc_dst;984 const AVPixFmtDescriptor *desc_dst;
985 const AVPixFmtDescriptor *desc_src;985 const AVPixFmtDescriptor *desc_src;
986 int need_reinit = 0;
986 memmove(c->srcColorspaceTable, inv_table, sizeof(int) * 4);987 memmove(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
987 memmove(c->dstColorspaceTable, table, sizeof(int) * 4);988 memmove(c->dstColorspaceTable, table, sizeof(int) * 4);
988 989
@@ -998,9 +999,14 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], · 9 unmodified lines
998 c->brightness = brightness;999 c->brightness = brightness;
999 c->contrast = contrast;1000 c->contrast = contrast;
1000 c->saturation = saturation;1001 c->saturation = saturation;
1002 if (c->srcRange != srcRange || c->dstRange != dstRange)
1003 need_reinit = 1;
1001 c->srcRange = srcRange;1004 c->srcRange = srcRange;
1002 c->dstRange = dstRange;1005 c->dstRange = dstRange;
1003 1006
1007 if (need_reinit && c->srcBpc == 8)
1008 ff_sws_init_range_convert(c);
1009
1004 if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat)))1010 if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat)))
1005 return -1;1011 return -1;
1006 1012

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