[FFmpeg-soc] [soc]: r4684 - in concat/libavformat: concatgen.c playlist.c
gkovacs
subversion at mplayerhq.hu
Sun Jul 12 23:48:02 CEST 2009
Author: gkovacs
Date: Sun Jul 12 23:48:01 2009
New Revision: 4684
Log:
switched fprintfs to av_log
Modified:
concat/libavformat/concatgen.c
concat/libavformat/playlist.c
Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c Sun Jul 12 22:23:52 2009 (r4683)
+++ concat/libavformat/concatgen.c Sun Jul 12 23:48:01 2009 (r4684)
@@ -44,7 +44,7 @@ int ff_concatgen_read_packet(AVFormatCon
if (pkt) {
int64_t time_offset;
time_offset = av_rescale_q(ctx->time_offsets[pkt->stream_index], AV_TIME_BASE_Q, ic->streams[stream_index]->time_base);
- fprintf(stderr, "%s conv stream time from %ld to %d/%d is %ld\n", ic->iformat->name, ctx->time_offsets[pkt->stream_index], ic->streams[stream_index]->time_base.num, ic->streams[stream_index]->time_base.den, time_offset);
+ av_log(ic, "%s conv stream time from %ld to %d/%d is %ld\n", ic->iformat->name, ctx->time_offsets[pkt->stream_index], ic->streams[stream_index]->time_base.num, ic->streams[stream_index]->time_base.den, time_offset);
// TODO changing either dts or pts leads to timing issues on h264
pkt->dts += time_offset;
if (!ic->streams[pkt->stream_index]->codec->has_b_frames)
@@ -53,7 +53,7 @@ int ff_concatgen_read_packet(AVFormatCon
} else if (ret < 0 && !have_switched_streams && ctx->pe_curidxs[stream_index] < ctx->pelist_size - 1) {
// TODO switch from AVERROR_EOF to AVERROR_EOS
// -32 AVERROR_EOF for avi, -51 for ogg
- printf("switching streams\n");
+ av_log(ic, AV_LOG_DEBUG, "Switching stream %d to %d\n", stream_index, ctx->pe_curidxs[stream_index]+1);
for (i = 0; i < ic->nb_streams && i < ctx->pe_curidxs_size; ++i) {
ctx->time_offsets[i] += ff_playlist_get_duration(ic, i);
}
@@ -62,7 +62,7 @@ int ff_concatgen_read_packet(AVFormatCon
have_switched_streams = 1;
goto retr;
} else {
- fprintf(stderr, "avpacket ret is %d\n", ret);
+ av_log(ic, AV_LOG_DEBUG, "Packet read error %d\n", ret);
}
return ret;
}
Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c Sun Jul 12 22:23:52 2009 (r4683)
+++ concat/libavformat/playlist.c Sun Jul 12 23:48:01 2009 (r4684)
@@ -40,31 +40,28 @@ void ff_playlist_init_playelem(PlayElem
av_log(pe->ic, AV_LOG_ERROR, "Error during av_open_input_file\n");
pe->fmt = pe->ic->iformat;
if (!pe->fmt) {
- fprintf(stderr, "pefmt not set\n");
+ av_log(pe->ic, AV_LOG_ERROR, "Input format not set\n");
}
err = av_find_stream_info(pe->ic);
if (err < 0) {
- av_log(pe->ic, AV_LOG_ERROR, "Error during av_open_input_file\n");
+ av_log(pe->ic, AV_LOG_ERROR, "Could not find stream info\n");
}
if(pe->ic->pb) {
pe->ic->pb->eof_reached = 0;
}
else {
- av_log(NULL, AV_LOG_ERROR, "failed pe ic pb not set\n");
- }
- if(!pe->fmt) {
- av_log(NULL, AV_LOG_ERROR, "failed pe ic fmt not set\n");
+ av_log(pe->ic, AV_LOG_ERROR, "ByteIOContext not set\n");
}
for (i = 0; i < pe->ic->nb_streams; ++i) {
AVCodec *codec = avcodec_find_decoder(pe->ic->streams[i]->codec->codec_id);
if (!codec) {
- fprintf(stderr, "output_packet: Decoder (codec id %d) not found for input stream #%d\n",
- pe->ic->streams[i]->codec->codec_id, i);
+ av_log(pe->ic->streams[i]->codec, AV_LOG_ERROR, "Decoder (codec id %d) not found for input stream #%d\n",
+ pe->ic->streams[i]->codec->codec_id, i);
return AVERROR(EINVAL);
}
if (avcodec_open(pe->ic->streams[i]->codec, codec) < 0) {
- fprintf(stderr, "output_packet: Error while opening decoder for input stream #%d\n",
- i);
+ av_log(pe->ic->streams[i]->codec, AV_LOG_ERROR, "Error while opening decoder for input stream #%d\n",
+ i);
return AVERROR(EINVAL);
}
}
@@ -119,8 +116,6 @@ int ff_playlist_populate_context(Playlis
int i;
AVFormatContext *ic;
AVFormatParameters *nap;
- fprintf(stderr, "playlist_populate_context called\n");
-// ctx->pelist[ctx->pe_curidxs[stream_index]] = av_malloc(sizeof(*(ctx->pelist[ctx->pe_curidxs[stream_index]])));
ff_playlist_init_playelem(ctx->pelist[ctx->pe_curidxs[stream_index]]);
ic = ctx->pelist[ctx->pe_curidxs[stream_index]]->ic;
nap = ctx->pelist[ctx->pe_curidxs[stream_index]]->ap;
More information about the FFmpeg-soc
mailing list