mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/dpx: parse image creator
This commit is contained in:
parent
0f8383005c
commit
abb0306bf3
@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavutil/intfloat.h"
|
#include "libavutil/intfloat.h"
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
@ -107,6 +108,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
AVFrame *const p = data;
|
AVFrame *const p = data;
|
||||||
uint8_t *ptr[AV_NUM_DATA_POINTERS];
|
uint8_t *ptr[AV_NUM_DATA_POINTERS];
|
||||||
uint32_t header_version, version = 0;
|
uint32_t header_version, version = 0;
|
||||||
|
char creator[101];
|
||||||
|
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
int magic_num, endian;
|
int magic_num, endian;
|
||||||
@ -360,6 +362,10 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
av_strlcpy(creator, avpkt->data + 160, 100);
|
||||||
|
creator[100] = '\0';
|
||||||
|
av_dict_set(&p->metadata, "Creator", creator, 0);
|
||||||
|
|
||||||
// Move pointer to offset from start of file
|
// Move pointer to offset from start of file
|
||||||
buf = avpkt->data + offset;
|
buf = avpkt->data + offset;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user