Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 1 Nov 2011 01:02:20 +0000 (02:02 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 1 Nov 2011 01:02:20 +0000 (02:02 +0100)
* qatar/master:
  cmdutils: Rename read_file to cmdutils_read_file

Conflicts:
ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
avconv.c
cmdutils.c
cmdutils.h
ffmpeg.c

diff --cc avconv.c
Simple merge
diff --cc cmdutils.c
Simple merge
diff --cc cmdutils.h
@@@ -323,8 -309,32 +323,8 @@@ int read_yesno(void)
   * @return 0 in case of success, a negative value corresponding to an
   * AVERROR error code in case of failure.
   */
- int read_file(const char *filename, char **bufptr, size_t *size);
+ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
  
 -typedef struct {
 -    int64_t num_faulty_pts; /// Number of incorrect PTS values so far
 -    int64_t num_faulty_dts; /// Number of incorrect DTS values so far
 -    int64_t last_pts;       /// PTS of the last frame
 -    int64_t last_dts;       /// DTS of the last frame
 -} PtsCorrectionContext;
 -
 -/**
 - * Reset the state of the PtsCorrectionContext.
 - */
 -void init_pts_correction(PtsCorrectionContext *ctx);
 -
 -/**
 - * Attempt to guess proper monotonic timestamps for decoded video frames
 - * which might have incorrect times. Input timestamps may wrap around, in
 - * which case the output will as well.
 - *
 - * @param pts the pts field of the decoded AVPacket, as passed through
 - * AVCodecContext.reordered_opaque
 - * @param dts the dts field of the decoded AVPacket
 - * @return one of the input values, may be AV_NOPTS_VALUE
 - */
 -int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t pts, int64_t dts);
 -
  /**
   * Get a file corresponding to a preset file.
   *
diff --cc ffmpeg.c
+++ b/ffmpeg.c
@@@ -2247,12 -2266,18 +2247,12 @@@ static int transcode_init(OutputFile *o
                  snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
                           pass_logfilename_prefix ? pass_logfilename_prefix : DEFAULT_PASS_LOGFILENAME_PREFIX,
                           i);
 -                if (codec->flags & CODEC_FLAG_PASS1) {
 -                    f = fopen(logfilename, "wb");
 -                    if (!f) {
 -                        fprintf(stderr, "Cannot write log file '%s' for pass-1 encoding: %s\n", logfilename, strerror(errno));
 -                        exit_program(1);
 -                    }
 -                    ost->logfile = f;
 -                } else {
 +                if (codec->flags & CODEC_FLAG_PASS2) {
                      char  *logbuffer;
                      size_t logbuffer_size;
-                     if (read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
+                     if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
 -                        fprintf(stderr, "Error reading log file '%s' for pass-2 encoding\n", logfilename);
 +                        av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
 +                               logfilename);
                          exit_program(1);
                      }
                      codec->stats_in = logbuffer;