"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavformat/mov.c" between
libav-12.tar.gz and libav-12.1.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

mov.c  (libav-12):mov.c  (libav-12.1)
skipping to change at line 39 skipping to change at line 39
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h" #include "libavutil/intfloat.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
#include "libavutil/time_internal.h" #include "libavutil/time_internal.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavutil/dict.h" #include "libavutil/dict.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavcodec/ac3tab.h" #include "libavcodec/ac3tab.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
#include "avio_internal.h" #include "avio_internal.h"
#include "riff.h" #include "riff.h"
#include "isom.h" #include "isom.h"
#include "libavcodec/get_bits.h" #include "libavcodec/get_bits.h"
#include "id3v1.h" #include "id3v1.h"
#include "mov_chan.h" #include "mov_chan.h"
#include "replaygain.h" #include "replaygain.h"
skipping to change at line 160 skipping to change at line 161
static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len, static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len,
char *dst, int dstlen) char *dst, int dstlen)
{ {
char *p = dst; char *p = dst;
char *end = dst+dstlen-1; char *end = dst+dstlen-1;
int i; int i;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
uint8_t t, c = avio_r8(pb); uint8_t t, c = avio_r8(pb);
if (c < 0x80 && p < end)
if (p >= end)
continue;
if (c < 0x80)
*p++ = c; *p++ = c;
else else
PUT_UTF8(mac_to_unicode[c-0x80], t, if (p < end) *p++ = t;); PUT_UTF8(mac_to_unicode[c-0x80], t, if (p < end) *p++ = t;);
} }
*p = 0; *p = 0;
return p - dst; return p - dst;
} }
static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len) static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
{ {
skipping to change at line 1085 skipping to change at line 1090
"%s: pri %"PRIu16" trc %"PRIu16" matrix %"PRIu16"", "%s: pri %"PRIu16" trc %"PRIu16" matrix %"PRIu16"",
color_parameter_type, color_primaries, color_trc, color_matrix); color_parameter_type, color_primaries, color_trc, color_matrix);
if (!strncmp(color_parameter_type, "nclx", 4)) { if (!strncmp(color_parameter_type, "nclx", 4)) {
uint8_t color_range = avio_r8(pb) >> 7; uint8_t color_range = avio_r8(pb) >> 7;
av_log(c->fc, AV_LOG_TRACE, " full %"PRIu8"", color_range); av_log(c->fc, AV_LOG_TRACE, " full %"PRIu8"", color_range);
if (color_range) if (color_range)
st->codecpar->color_range = AVCOL_RANGE_JPEG; st->codecpar->color_range = AVCOL_RANGE_JPEG;
else else
st->codecpar->color_range = AVCOL_RANGE_MPEG; st->codecpar->color_range = AVCOL_RANGE_MPEG;
/* 14496-12 references JPEG XR specs (rather than the more complete
* 23001-8) so some adjusting is required */ if (!av_color_primaries_name(color_primaries))
if (color_primaries >= AVCOL_PRI_FILM)
color_primaries = AVCOL_PRI_UNSPECIFIED; color_primaries = AVCOL_PRI_UNSPECIFIED;
if ((color_trc >= AVCOL_TRC_LINEAR && if (!av_color_transfer_name(color_trc))
color_trc <= AVCOL_TRC_LOG_SQRT) ||
color_trc >= AVCOL_TRC_BT2020_10)
color_trc = AVCOL_TRC_UNSPECIFIED; color_trc = AVCOL_TRC_UNSPECIFIED;
if (color_matrix >= AVCOL_SPC_BT2020_NCL) if (!av_color_space_name(color_matrix))
color_matrix = AVCOL_SPC_UNSPECIFIED; color_matrix = AVCOL_SPC_UNSPECIFIED;
st->codecpar->color_primaries = color_primaries; st->codecpar->color_primaries = color_primaries;
st->codecpar->color_trc = color_trc; st->codecpar->color_trc = color_trc;
st->codecpar->color_space = color_matrix; st->codecpar->color_space = color_matrix;
} else if (!strncmp(color_parameter_type, "nclc", 4)) { } else if (!strncmp(color_parameter_type, "nclc", 4)) {
/* color primaries, Table 4-4 */ /* color primaries, Table 4-4 */
switch (color_primaries) { switch (color_primaries) {
case 1: st->codecpar->color_primaries = AVCOL_PRI_BT709; break; case 1: st->codecpar->color_primaries = AVCOL_PRI_BT709; break;
case 5: st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M; break; case 5: st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M; break;
case 6: st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M; break; case 6: st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M; break;
case 9: st->codecpar->color_primaries = AVCOL_PRI_BT2020; break;
case 10: st->codecpar->color_primaries = AVCOL_PRI_SMPTE431; break;
case 11: st->codecpar->color_primaries = AVCOL_PRI_SMPTE432; break;
} }
/* color transfer, Table 4-5 */ /* color transfer, Table 4-5 */
switch (color_trc) { switch (color_trc) {
case 1: st->codecpar->color_trc = AVCOL_TRC_BT709; break; case 1: st->codecpar->color_trc = AVCOL_TRC_BT709; break;
case 7: st->codecpar->color_trc = AVCOL_TRC_SMPTE240M; break; case 7: st->codecpar->color_trc = AVCOL_TRC_SMPTE240M; break;
case 17: st->codecpar->color_trc = AVCOL_TRC_SMPTE428; break;
} }
/* color matrix, Table 4-6 */ /* color matrix, Table 4-6 */
switch (color_matrix) { switch (color_matrix) {
case 1: st->codecpar->color_space = AVCOL_SPC_BT709; break; case 1: st->codecpar->color_space = AVCOL_SPC_BT709; break;
case 6: st->codecpar->color_space = AVCOL_SPC_BT470BG; break; case 6: st->codecpar->color_space = AVCOL_SPC_BT470BG; break;
case 7: st->codecpar->color_space = AVCOL_SPC_SMPTE240M; break; case 7: st->codecpar->color_space = AVCOL_SPC_SMPTE240M; break;
case 9: st->codecpar->color_space = AVCOL_SPC_BT2020_NCL; break;
} }
} }
av_log(c->fc, AV_LOG_TRACE, "\n"); av_log(c->fc, AV_LOG_TRACE, "\n");
return 0; return 0;
} }
static int mov_read_fiel(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_fiel(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{ {
AVStream *st; AVStream *st;
skipping to change at line 1896 skipping to change at line 1904
if (c->fc->nb_streams < 1) if (c->fc->nb_streams < 1)
return 0; return 0;
st = c->fc->streams[c->fc->nb_streams - 1]; st = c->fc->streams[c->fc->nb_streams - 1];
sc = st->priv_data; sc = st->priv_data;
avio_r8(pb); /* version */ avio_r8(pb); /* version */
avio_rb24(pb); /* flags */ avio_rb24(pb); /* flags */
entries = avio_rb32(pb); entries = avio_rb32(pb);
if (sc->extradata) {
av_log(c->fc, AV_LOG_ERROR,
"Duplicate stsd found in this track.\n");
return AVERROR_INVALIDDATA;
}
/* Prepare space for hosting multiple extradata. */ /* Prepare space for hosting multiple extradata. */
sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata)); sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata));
if (!sc->extradata) if (!sc->extradata)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
sc->stsd_count = entries; sc->stsd_count = entries;
sc->extradata_size = av_mallocz_array(sc->stsd_count, sizeof(*sc->extradata_ size)); sc->extradata_size = av_mallocz_array(sc->stsd_count, sizeof(*sc->extradata_ size));
if (!sc->extradata_size) if (!sc->extradata_size)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
 End of changes. 10 change blocks. 
8 lines changed or deleted 22 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS