]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/wtvdec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / wtvdec.c
index 5cbec0576a97d219ee5b7a7e260af0cca3847e73..f13dc743720e7b913b40cb65ac567791ecf39f25 100644 (file)
@@ -164,7 +164,6 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
         }
         wf->sectors[0]  = first_sector;
         wf->nb_sectors  = 1;
-        wf->sector_bits = WTV_SECTOR_BITS;
     } else if (depth == 1) {
         wf->sectors = av_malloc(WTV_SECTOR_SIZE);
         if (!wf->sectors) {
@@ -172,7 +171,6 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
             return NULL;
         }
         wf->nb_sectors  = read_ints(s->pb, wf->sectors, WTV_SECTOR_SIZE / 4);
-        wf->sector_bits = length & (1ULL<<63) ? WTV_SECTOR_BITS : WTV_BIGSECTOR_BITS;
     } else if (depth == 2) {
         uint32_t sectors1[WTV_SECTOR_SIZE / 4];
         int nb_sectors1 = read_ints(s->pb, sectors1, WTV_SECTOR_SIZE / 4);
@@ -189,12 +187,12 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
                 break;
             wf->nb_sectors += read_ints(s->pb, wf->sectors + i * WTV_SECTOR_SIZE / 4, WTV_SECTOR_SIZE / 4);
         }
-        wf->sector_bits = length & (1ULL<<63) ? WTV_SECTOR_BITS : WTV_BIGSECTOR_BITS;
     } else {
         av_log(s, AV_LOG_ERROR, "unsupported file allocation table depth (0x%x)\n", depth);
         av_free(wf);
         return NULL;
     }
+    wf->sector_bits = length & (1ULL<<63) ? WTV_SECTOR_BITS : WTV_BIGSECTOR_BITS;
 
     if (!wf->nb_sectors) {
         av_free(wf->sectors);
@@ -431,7 +429,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
     st = av_new_stream(s, 0);
     if (!st)
         goto done;
-    av_metadata_set2(&st->metadata, "title", description, 0);
+    av_dict_set(&st->metadata, "title", description, 0);
     st->codec->codec_id   = CODEC_ID_MJPEG;
     st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
     st->codec->extradata  = av_mallocz(filesize);
@@ -494,7 +492,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
         return;
     }
 
-    av_metadata_set2(&s->metadata, key, buf, 0);
+    av_dict_set(&s->metadata, key, buf, 0);
     av_freep(&buf);
 }
 
@@ -716,7 +714,7 @@ enum {
  * Parse WTV chunks
  * @param mode SEEK_TO_DATA or SEEK_TO_PTS
  * @param seekts timestamp
- * @param[out] len Length of data chunk
+ * @param[out] len_ptr Length of data chunk
  * @return stream index of data chunk, or <0 on error
  */
 static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_ptr)
@@ -818,7 +816,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
                 avio_read(pb, language, 3);
                 if (language[0]) {
                     language[3] = 0;
-                    av_metadata_set2(&st->metadata, "language", language, 0);
+                    av_dict_set(&st->metadata, "language", language, 0);
                     if (!strcmp(language, "nar") || !strcmp(language, "NAR"))
                         st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
                 }