Permalink
Browse files

Roll-up of all changes after the previous sync

  • Loading branch information...
Beirdo committed Apr 1, 2012
1 parent 9cb02de commit 940dd94d1ac092f61d9eebab542c96b7b54b7d45
@@ -108,7 +108,7 @@ GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
.version: M=@
version.h .version:
- $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
+ $(M)$(VERSION_SH) $(SRC_PATH)/external/FFmpeg version.h $(EXTRA_VERSION)
$(Q)touch .version
# force version.sh to run whenever version might have changed
@@ -712,6 +712,10 @@ static int decode_audio_specific_config(AACContext *ac,
return -1;
}
+ av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
+ m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
+ m4ac->sample_rate, m4ac->sbr, m4ac->ps);
+
av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
m4ac->sample_rate, m4ac->sbr, m4ac->ps);
@@ -2593,6 +2597,8 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
av_log(avctx, AV_LOG_INFO, "audio config changed\n");
latmctx->initialized = 0;
+ ac->m4ac= m4ac;
+
esize = (bits_consumed+7) / 8;
if (avctx->extradata_size < esize) {
@@ -2769,6 +2775,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
*got_frame_ptr = 0;
return avpkt->size;
} else {
+ aac_decode_close(avctx);
if ((err = decode_audio_specific_config(
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.m4ac,
avctx->extradata, avctx->extradata_size*8, 1)) < 0)
@@ -1240,6 +1240,13 @@ typedef struct AVFrame {
uint8_t atsc_cc_buf[1024];\
int atsc_cc_len;
+ /** SCTE CC data CEA-608
+ * - encoding: unused
+ * - decoding: Set by libavcodec
+ */
+ uint8_t scte_cc_buf[1024];
+ int scte_cc_len;
+
} AVFrame;
struct AVCodecInternal;
@@ -3135,6 +3142,7 @@ typedef struct AVSubtitle {
unsigned num_rects;
AVSubtitleRect **rects;
int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
+ int forced;
} AVSubtitle;
/* packet functions */
@@ -1497,6 +1497,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
p = buf;
p_end = buf + buf_size;
+ int gotpage, gotregion, gotclut, gotobject, gotdisplay = 0;
while (p_end - p >= 6 && *p == 0x0f) {
p += 1;
segment_type = *p++;
@@ -1516,25 +1517,30 @@ static int dvbsub_decode(AVCodecContext *avctx,
case DVBSUB_PAGE_SEGMENT:
dvbsub_parse_page_segment(avctx, p, segment_length);
got_segment |= 1;
+ gotpage = 1;
break;
case DVBSUB_REGION_SEGMENT:
dvbsub_parse_region_segment(avctx, p, segment_length);
got_segment |= 2;
+ gotregion = 1;
break;
case DVBSUB_CLUT_SEGMENT:
dvbsub_parse_clut_segment(avctx, p, segment_length);
got_segment |= 4;
+ gotclut = 1;
break;
case DVBSUB_OBJECT_SEGMENT:
dvbsub_parse_object_segment(avctx, p, segment_length);
got_segment |= 8;
+ gotobject = 1;
break;
case DVBSUB_DISPLAYDEFINITION_SEGMENT:
dvbsub_parse_display_definition_segment(avctx, p, segment_length);
break;
case DVBSUB_DISPLAY_SEGMENT:
*data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
got_segment |= 16;
+ gotdisplay = 1;
break;
default:
av_dlog(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
@@ -1550,6 +1556,11 @@ static int dvbsub_decode(AVCodecContext *avctx,
if (got_segment == 15 && sub)
*data_size = dvbsub_display_end_segment(avctx, p, 0, sub);
+ // Some streams do not send a display segment but if we have all the other
+ // segments then we need no further data. see #9373
+ if ((gotpage & gotregion & gotclut & gotobject) && !gotdisplay && sub)
+ *data_size = dvbsub_display_end_segment(avctx, p, 0, sub);
+
return p - buf;
}
@@ -367,7 +367,10 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
cmd_pos = next_cmd_pos;
}
if (sub_header->num_rects > 0)
+ {
+ sub_header->forced = is_menu;
return is_menu;
+ }
fail:
if (sub_header->rects != NULL) {
for (i = 0; i < sub_header->num_rects; i++) {
@@ -135,7 +135,11 @@ for examples see get_bits, show_bits, skip_bits, get_vlc
name##_index < name##_size_plus8
#endif
-#define CLOSE_READER(name, gb) (gb)->index = name##_index
+// Added the void use of the cache to defeat compiler warnings with newer gcc
+// (warning: variable 're_cache" set but not used)
+# define CLOSE_READER(name, gb) \
+ (gb)->index = name##_index; \
+ (void)name##_cache
#ifdef BITSTREAM_READER_LE
@@ -2215,14 +2215,14 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
unsigned int cc_bytes = (cc_bits + 7 - 3) / 8;
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
- if (buf_end - p >= (2+cc_bytes) && (s->tmp_atsc_cc_len + 2 + 3*cc_count) < ATSC_CC_BUF_SIZE) {
- int atsc_cnt_loc = s->tmp_atsc_cc_len;
+ if (buf_end - p >= (2+cc_bytes) && (s->tmp_scte_cc_len + 2 + 3*cc_count) < SCTE_CC_BUF_SIZE) {
+ int scte_cnt_loc = s->tmp_scte_cc_len;
uint8_t real_count = 0, marker = 1, i;
GetBitContext gb;
init_get_bits(&gb, p+2, (buf_end-p-2) * sizeof(uint8_t));
get_bits(&gb, 5); // swallow cc_count
- s->tmp_atsc_cc_buf[s->tmp_atsc_cc_len++] = 0x40 | (0x1f&cc_count);
- s->tmp_atsc_cc_buf[s->tmp_atsc_cc_len++] = 0x00; // em_data
+ s->tmp_scte_cc_buf[s->tmp_scte_cc_len++] = 0x40 | (0x1f&cc_count);
+ s->tmp_scte_cc_buf[s->tmp_scte_cc_len++] = 0x00; // em_data
for (i = 0; i < cc_count; i++) {
uint8_t valid, cc608_hdr;
uint8_t priority = get_bits(&gb, 2);
@@ -2243,18 +2243,18 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
continue;
cc608_hdr = 0xf8 | (valid ? 0x04 : 0x00) | type;
real_count++;
- s->tmp_atsc_cc_buf[s->tmp_atsc_cc_len++] = cc608_hdr;
- s->tmp_atsc_cc_buf[s->tmp_atsc_cc_len++] = cc_data_1;
- s->tmp_atsc_cc_buf[s->tmp_atsc_cc_len++] = cc_data_2;
+ s->tmp_scte_cc_buf[s->tmp_scte_cc_len++] = cc608_hdr;
+ s->tmp_scte_cc_buf[s->tmp_scte_cc_len++] = cc_data_1;
+ s->tmp_scte_cc_buf[s->tmp_scte_cc_len++] = cc_data_2;
}
if (!real_count)
{
- s->tmp_atsc_cc_len = atsc_cnt_loc;
+ s->tmp_scte_cc_len = scte_cnt_loc;
}
else
{
- s->tmp_atsc_cc_buf[atsc_cnt_loc] = 0x40 | (0x1f&real_count);
- s->tmp_atsc_cc_len = atsc_cnt_loc + 2 + 3 * real_count;
+ s->tmp_scte_cc_buf[scte_cnt_loc] = 0x40 | (0x1f&real_count);
+ s->tmp_scte_cc_len = scte_cnt_loc + 2 + 3 * real_count;
}
}
} else if (buf_end - p >= 11 &&
@@ -1192,6 +1192,9 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
memcpy(pic->f.atsc_cc_buf, s->tmp_atsc_cc_buf, s->tmp_atsc_cc_len);
pic->f.atsc_cc_len = s->tmp_atsc_cc_len;
s->tmp_atsc_cc_len = 0;
+ memcpy(pic->f.scte_cc_buf, s->tmp_scte_cc_buf, s->tmp_scte_cc_len);
+ pic->f.scte_cc_len = s->tmp_scte_cc_len;
+ s->tmp_scte_cc_len = 0;
pic->f.coded_picture_number = s->coded_picture_number++;
@@ -678,6 +678,9 @@ typedef struct MpegEncContext {
/// frame for these packets has been created in MPV_frame_start().
uint8_t tmp_atsc_cc_buf[ATSC_CC_BUF_SIZE];
int tmp_atsc_cc_len;
+#define SCTE_CC_BUF_SIZE 1024
+ uint8_t tmp_scte_cc_buf[SCTE_CC_BUF_SIZE];
+ int tmp_scte_cc_len;
int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
#define SLICE_OK 0
@@ -214,6 +214,9 @@ const char *ff_codec_id_string(enum CodecID codec_id)
case CODEC_ID_MPEG2TS: return "MPEG2TS";
+ /* Attachment codecs */
+ case CODEC_ID_TTF: return "TTF font";
+
case CODEC_ID_PROBE: return "PROBE";
}
return "Unknown Codec ID";
@@ -231,6 +234,7 @@ const char *ff_codec_type_string(enum AVMediaType codec_type)
case AVMEDIA_TYPE_AUDIO: return "Audio";
case AVMEDIA_TYPE_DATA: return "Data";
case AVMEDIA_TYPE_SUBTITLE: return "Subtitle";
+ case AVMEDIA_TYPE_ATTACHMENT: return "Attachment";
}
return "Invalid Codec Type";
};
@@ -51,6 +51,7 @@ typedef struct PGSSubPictureReference {
typedef struct PGSSubPresentation {
int id_number;
int object_count;
+ int object_forced;
PGSSubPictureReference *objects;
} PGSSubPresentation;
@@ -342,6 +343,7 @@ static void parse_presentation_segment(AVCodecContext *avctx,
buf++;
/* composition_flag (0x80 - object cropped, 0x40 - object forced) */
reference->composition = bytestream_get_byte(&buf);
+ ctx->presentation.object_forced = (reference->composition & 0x40) >> 6;
reference->x = bytestream_get_be16(&buf);
reference->y = bytestream_get_be16(&buf);
@@ -393,6 +395,7 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
if (!ctx->presentation.object_count)
return 1;
+ sub->forced = ctx->presentation.object_forced;
sub->start_display_time = 0;
sub->end_display_time = 20000;
sub->format = 0;
@@ -70,7 +70,11 @@ X(\name):
.macro movrel rd, sym, gp
#if CONFIG_PIC
- lwz \rd, \sym@got(\gp)
+ bcl 20, 31, lab_pic_\@
+lab_pic_\@:
+ mflr \rd
+ addis \rd, \rd, (\sym - lab_pic_\@)@ha
+ addi \rd, \rd, (\sym - lab_pic_\@)@l
#else
lis \rd, \sym@ha
la \rd, \sym@l(\rd)
Oops, something went wrong.

0 comments on commit 940dd94

Please sign in to comment.