diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-26 21:04:53 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-29 19:30:25 +0100 |
commit | 24a654c6c96310b1b408a6d053ad52de41640e5e (patch) | |
tree | 5415daceddbcfe3f2623a18c23ae3f9fdede5d19 /libavcodec/mpegvideo.h | |
parent | 5a04c6a2697568c2b7233a0a9f4f20aa8a2a1706 (diff) | |
download | ffmpeg-24a654c6c96310b1b408a6d053ad52de41640e5e.tar.gz |
avcodec/mpegvideo: Use offset instead of pointer for vbv_delay
An offset has the advantage of not needing to be updated
when the buffer is reallocated. Furthermore, the way the pointer
is currently updated is undefined behaviour in case the pointer
is not already set (i.e. when not encoding MPEG-1/2), because
it calculates the nonsense NULL - s->pb.buf.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpegvideo.h')
-rw-r--r-- | libavcodec/mpegvideo.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 86954348f0..84d79d2e59 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -432,7 +432,7 @@ typedef struct MpegEncContext { /* MPEG-1 specific */ int last_mv_dir; ///< last mv_dir, used for B-frame encoding - uint8_t *vbv_delay_ptr; ///< pointer to vbv_delay in the bitstream + int vbv_delay_pos; ///< offset of vbv_delay in the bitstream /* MPEG-2-specific - I wished not to have to support this mess. */ int progressive_sequence; |