mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 13:17:13 +00:00
Fix Gui colors for 32 bit png images after switch to libavcodec decoding
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23243 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
fd7fa9ee0a
commit
6b8dfb15a6
11
gui/bitmap.c
11
gui/bitmap.c
@ -10,6 +10,7 @@
|
|||||||
#else
|
#else
|
||||||
#include "libavcodec/avcodec.h"
|
#include "libavcodec/avcodec.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libvo/fastmemcpy.h"
|
#include "libvo/fastmemcpy.h"
|
||||||
|
|
||||||
static int pngRead( unsigned char * fname,txSample * bf )
|
static int pngRead( unsigned char * fname,txSample * bf )
|
||||||
@ -80,11 +81,9 @@ static int conv24to32( txSample * bf )
|
|||||||
mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] not enough memory for image\n" );
|
mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] not enough memory for image\n" );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for ( c=0,i=0; c < bf->ImageSize; )
|
for ( c=0,i=0; c < bf->ImageSize; c += 4, i += 3)
|
||||||
{
|
{
|
||||||
bf->Image[c++]=tmpImage[i++]; //red
|
*(uint32_t *)&bf->Image[c] = AV_RB24(&tmpImage[i]);
|
||||||
bf->Image[c++]=tmpImage[i++]; //green
|
|
||||||
bf->Image[c++]=tmpImage[i++]; c++; //blue
|
|
||||||
}
|
}
|
||||||
free( tmpImage );
|
free( tmpImage );
|
||||||
}
|
}
|
||||||
@ -151,10 +150,6 @@ int bpRead( char * fname, txSample * bf )
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ( conv24to32( bf ) ) return -8;
|
if ( conv24to32( bf ) ) return -8;
|
||||||
#ifdef WORDS_BIGENDIAN
|
|
||||||
swab(bf->Image, bf->Image, bf->ImageSize);
|
|
||||||
#endif
|
|
||||||
bgr2rgb( bf );
|
|
||||||
Normalize( bf );
|
Normalize( bf );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user