[FFmpeg-cvslog] lavf/dv: set non-changing AVStream fields only once

Anton Khirnov git at videolan.org
Mon Sep 5 10:01:17 EEST 2022


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Aug 23 14:38:17 2022 +0200| [000b8d2acc53b23eaccf7a2d3e650f7e633bd3b6] | committer: Anton Khirnov

lavf/dv: set non-changing AVStream fields only once

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=000b8d2acc53b23eaccf7a2d3e650f7e633bd3b6
---

 libavformat/dv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 24d6897da5..f65c2d596f 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -278,6 +278,8 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame)
             avpriv_set_pts_info(c->ast[i], 64, c->sys->time_base.num, c->sys->time_base.den);
             c->ast[i]->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
             c->ast[i]->codecpar->codec_id   = AV_CODEC_ID_PCM_S16LE;
+            c->ast[i]->codecpar->ch_layout  = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
+            c->ast[i]->start_time           = 0;
 
             c->audio_pkt[i].size         = 0;
             c->audio_pkt[i].data         = c->audio_buf[i];
@@ -288,9 +290,7 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame)
             c->audio_pkt[i].pos          = -1;
         }
         c->ast[i]->codecpar->sample_rate    = dv_audio_frequency[freq];
-        c->ast[i]->codecpar->ch_layout      = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
         c->ast[i]->codecpar->bit_rate       = 2 * dv_audio_frequency[freq] * 16;
-        c->ast[i]->start_time            = 0;
     }
     c->ach = ach;
 



More information about the ffmpeg-cvslog mailing list