diff mbox series

[FFmpeg-devel,v2] avformat/dvdvideodec: use int64_t for menu blocks_read and fix format statement

Message ID 20240312154738.2360856-1-marth64@proxyid.net
State New
Headers show
Series [FFmpeg-devel,v2] avformat/dvdvideodec: use int64_t for menu blocks_read and fix format statement | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marth64 March 12, 2024, 3:47 p.m. UTC
Signed-off-by: Marth64 <marth64@proxyid.net>
---
 libavformat/dvdvideodec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andreas Rheinhardt March 12, 2024, 3:48 p.m. UTC | #1
Marth64:
> Signed-off-by: Marth64 <marth64@proxyid.net>
> ---
>  libavformat/dvdvideodec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c
> index a182f95097..19efc068cb 100644
> --- a/libavformat/dvdvideodec.c
> +++ b/libavformat/dvdvideodec.c
> @@ -392,7 +392,7 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState
>                                         uint8_t *buf, int buf_size,
>                                         void (*flush_cb)(AVFormatContext *s))
>  {
> -    ssize_t blocks_read                   = 0;
> +    int64_t blocks_read                   = 0;
>      uint8_t read_buf[DVDVIDEO_BLOCK_SIZE] = {0};
>      pci_t pci                             = (pci_t) {0};
>      dsi_t dsi                             = (dsi_t) {0};
> @@ -423,7 +423,7 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState
>  
>      blocks_read = DVDReadBlocks(state->vob_file, state->sector_offset, 1, read_buf);
>      if (blocks_read != 1) {
> -        av_log(s, AV_LOG_ERROR, "Unable to read VOB block: offset=%d blocks_read=%d\n",
> +        av_log(s, AV_LOG_ERROR, "Unable to read VOB block: offset=%d blocks_read=%ld\n",
>                                  state->sector_offset, blocks_read);
>  
>          return AVERROR_INVALIDDATA;

ld is for long, not necessarily for int64_t.

- Andreas
Marth64 March 12, 2024, 3:55 p.m. UTC | #2
Fix on the way with PRId64
diff mbox series

Patch

diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c
index a182f95097..19efc068cb 100644
--- a/libavformat/dvdvideodec.c
+++ b/libavformat/dvdvideodec.c
@@ -392,7 +392,7 @@  static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState
                                        uint8_t *buf, int buf_size,
                                        void (*flush_cb)(AVFormatContext *s))
 {
-    ssize_t blocks_read                   = 0;
+    int64_t blocks_read                   = 0;
     uint8_t read_buf[DVDVIDEO_BLOCK_SIZE] = {0};
     pci_t pci                             = (pci_t) {0};
     dsi_t dsi                             = (dsi_t) {0};
@@ -423,7 +423,7 @@  static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState
 
     blocks_read = DVDReadBlocks(state->vob_file, state->sector_offset, 1, read_buf);
     if (blocks_read != 1) {
-        av_log(s, AV_LOG_ERROR, "Unable to read VOB block: offset=%d blocks_read=%d\n",
+        av_log(s, AV_LOG_ERROR, "Unable to read VOB block: offset=%d blocks_read=%ld\n",
                                 state->sector_offset, blocks_read);
 
         return AVERROR_INVALIDDATA;