[vlc-commits] image: make the write URL output video format const
Steve Lhomme
git at videolan.org
Fri Feb 8 14:00:48 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb 8 13:55:49 2019 +0100| [d7b00ce1b2f350708e9bdde05d1e8bdb5d0a48af] | committer: Steve Lhomme
image: make the write URL output video format const
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d7b00ce1b2f350708e9bdde05d1e8bdb5d0a48af
---
include/vlc_image.h | 2 +-
src/misc/image.c | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/vlc_image.h b/include/vlc_image.h
index 78a4ab98a4..250974f368 100644
--- a/include/vlc_image.h
+++ b/include/vlc_image.h
@@ -45,7 +45,7 @@ struct image_handler_t
block_t * (*pf_write) ( image_handler_t *, picture_t *,
const video_format_t *, const video_format_t * );
int (*pf_write_url) ( image_handler_t *, picture_t *,
- const video_format_t *, video_format_t *,
+ const video_format_t *, const video_format_t *,
const char * );
picture_t * (*pf_convert) ( image_handler_t *, picture_t *,
diff --git a/src/misc/image.c b/src/misc/image.c
index b9482b8700..6c18f84720 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -67,7 +67,7 @@ static picture_t *ImageReadUrl( image_handler_t *, const char *,
static block_t *ImageWrite( image_handler_t *, picture_t *,
const video_format_t *, const video_format_t * );
static int ImageWriteUrl( image_handler_t *, picture_t *,
- const video_format_t *, video_format_t *, const char * );
+ const video_format_t *, const video_format_t *, const char * );
static picture_t *ImageConvert( image_handler_t *, picture_t *,
const video_format_t *, video_format_t * );
@@ -454,16 +454,17 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
}
static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic,
- const video_format_t *p_fmt_in, video_format_t *p_fmt_out,
+ const video_format_t *p_fmt_in, const video_format_t *p_fmt_out,
const char *psz_url )
{
block_t *p_block;
FILE *file;
+ video_format_t fmt_out = *p_fmt_out;
- if( !p_fmt_out->i_chroma )
+ if( !fmt_out.i_chroma )
{
/* Try to guess format from file name */
- p_fmt_out->i_chroma = image_Ext2Fourcc( psz_url );
+ fmt_out.i_chroma = image_Ext2Fourcc( psz_url );
}
file = vlc_fopen( psz_url, "wb" );
@@ -473,7 +474,7 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic,
return VLC_EGENERIC;
}
- p_block = ImageWrite( p_image, p_pic, p_fmt_in, p_fmt_out );
+ p_block = ImageWrite( p_image, p_pic, p_fmt_in, &fmt_out );
int err = 0;
if( p_block )
More information about the vlc-commits
mailing list