Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: source/patched-ffmpeg-mt/libavformat/mpegenc.c

Issue 4533003: patched ffmpeg nov 2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * MPEG1/2 muxer 2 * MPEG1/2 muxer
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard 3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4 * 4 *
5 * This file is part of FFmpeg. 5 * This file is part of FFmpeg.
6 * 6 *
7 * FFmpeg is free software; you can redistribute it and/or 7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version. 10 * version 2.1 of the License, or (at your option) any later version.
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 uint8_t *buf= pkt->data; 1155 uint8_t *buf= pkt->data;
1156 AVStream *st = ctx->streams[stream_index]; 1156 AVStream *st = ctx->streams[stream_index];
1157 StreamInfo *stream = st->priv_data; 1157 StreamInfo *stream = st->priv_data;
1158 int64_t pts, dts; 1158 int64_t pts, dts;
1159 PacketDesc *pkt_desc; 1159 PacketDesc *pkt_desc;
1160 const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE); 1160 const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE);
1161 const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->f lags & AV_PKT_FLAG_KEY); 1161 const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->f lags & AV_PKT_FLAG_KEY);
1162 1162
1163 pts= pkt->pts; 1163 pts= pkt->pts;
1164 dts= pkt->dts; 1164 dts= pkt->dts;
1165 if(!s->last_scr)
1166 s->last_scr= dts;
1167 1165
1168 if(pts != AV_NOPTS_VALUE) pts += preload; 1166 if(pts != AV_NOPTS_VALUE) pts += 2*preload;
1169 if(dts != AV_NOPTS_VALUE) dts += preload; 1167 if(dts != AV_NOPTS_VALUE){
1168 if(!s->last_scr)
1169 s->last_scr= dts + preload;
1170 dts += 2*preload;
1171 }
1170 1172
1171 //av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/9 0000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE); 1173 //av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/9 0000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE);
1172 if (!stream->premux_packet) 1174 if (!stream->premux_packet)
1173 stream->next_packet = &stream->premux_packet; 1175 stream->next_packet = &stream->premux_packet;
1174 *stream->next_packet= 1176 *stream->next_packet=
1175 pkt_desc= av_mallocz(sizeof(PacketDesc)); 1177 pkt_desc= av_mallocz(sizeof(PacketDesc));
1176 pkt_desc->pts= pts; 1178 pkt_desc->pts= pts;
1177 pkt_desc->dts= dts; 1179 pkt_desc->dts= dts;
1178 pkt_desc->unwritten_size= 1180 pkt_desc->unwritten_size=
1179 pkt_desc->size= size; 1181 pkt_desc->size= size;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 "video/mpeg", 1299 "video/mpeg",
1298 "dvd", 1300 "dvd",
1299 sizeof(MpegMuxContext), 1301 sizeof(MpegMuxContext),
1300 CODEC_ID_MP2, 1302 CODEC_ID_MP2,
1301 CODEC_ID_MPEG2VIDEO, 1303 CODEC_ID_MPEG2VIDEO,
1302 mpeg_mux_init, 1304 mpeg_mux_init,
1303 mpeg_mux_write_packet, 1305 mpeg_mux_write_packet,
1304 mpeg_mux_end, 1306 mpeg_mux_end,
1305 }; 1307 };
1306 #endif 1308 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698