[FFmpeg-cvslog] lavf/mov: factor out setting codec_id

John Stebbins git at videolan.org
Sun Sep 9 01:54:14 EEST 2018


ffmpeg | branch: master | John Stebbins <jstebbins at jetheaddev.com> | Fri Aug 31 09:00:39 2018 -0700| [3318ac5b9a7c3f3b37163e1a048841648845ab35] | committer: James Almer

lavf/mov: factor out setting codec_id

Since it is performed in all cases now.

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavformat/mov.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index aa8022ae52..02c8ec66ed 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2494,22 +2494,19 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
                "size=%"PRId64" 4CC=%s codec_type=%d\n", size,
                av_fourcc2str(format), st->codecpar->codec_type);
 
+        st->codecpar->codec_id = id;
         if (st->codecpar->codec_type==AVMEDIA_TYPE_VIDEO) {
-            st->codecpar->codec_id = id;
             mov_parse_stsd_video(c, pb, st, sc);
         } else if (st->codecpar->codec_type==AVMEDIA_TYPE_AUDIO) {
-            st->codecpar->codec_id = id;
             mov_parse_stsd_audio(c, pb, st, sc);
             if (st->codecpar->sample_rate < 0) {
                 av_log(c->fc, AV_LOG_ERROR, "Invalid sample rate %d\n", st->codecpar->sample_rate);
                 return AVERROR_INVALIDDATA;
             }
         } else if (st->codecpar->codec_type==AVMEDIA_TYPE_SUBTITLE){
-            st->codecpar->codec_id = id;
             mov_parse_stsd_subtitle(c, pb, st, sc,
                                     size - (avio_tell(pb) - start_pos));
         } else {
-            st->codecpar->codec_id = id;
             ret = mov_parse_stsd_data(c, pb, st, sc,
                                       size - (avio_tell(pb) - start_pos));
             if (ret < 0)



More information about the ffmpeg-cvslog mailing list