[FFmpeg-soc] [soc]: r5243 - in concat/libavformat: avplaylist.c avplaylist.h
gkovacs
subversion at mplayerhq.hu
Mon Aug 24 08:38:40 CEST 2009
Author: gkovacs
Date: Mon Aug 24 08:38:39 2009
New Revision: 5243
Log:
error checking in av_playlist_set_streams
Modified:
concat/libavformat/avplaylist.c
concat/libavformat/avplaylist.h
Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c Mon Aug 24 08:35:31 2009 (r5242)
+++ concat/libavformat/avplaylist.c Mon Aug 24 08:38:39 2009 (r5243)
@@ -73,7 +73,7 @@ int av_playlist_populate_context(AVPlayl
return 0;
}
-void av_playlist_set_streams(AVFormatContext *s)
+int av_playlist_set_streams(AVFormatContext *s)
{
int i;
AVPlaylistContext *ctx = s->priv_data;
@@ -91,14 +91,14 @@ void av_playlist_set_streams(AVFormatCon
"Decoder (codec id %d) not found for input stream #%d\n",
ic->streams[i]->codec->codec_id,
ic->streams[i]->index);
- return;
+ return AVERROR_NOFMT;
}
if (avcodec_open(ic->streams[i]->codec, codec) < 0) {
av_log(ic->streams[i]->codec,
AV_LOG_ERROR,
"Error while opening decoder for input stream #%d\n",
ic->streams[i]->index);
- return;
+ return AVERROR_IO;
}
}
}
@@ -109,6 +109,7 @@ void av_playlist_set_streams(AVFormatCon
s->iformat->read_timestamp = ff_concatgen_read_timestamp;
else
s->iformat->read_timestamp = NULL;
+ return 0;
}
AVPlaylistContext *av_playlist_get_context(AVFormatContext *ic)
Modified: concat/libavformat/avplaylist.h
==============================================================================
--- concat/libavformat/avplaylist.h Mon Aug 24 08:35:31 2009 (r5242)
+++ concat/libavformat/avplaylist.h Mon Aug 24 08:38:39 2009 (r5243)
@@ -63,8 +63,9 @@ int av_playlist_populate_context(AVPlayl
/** @brief Sets the master concat-type demuxer's streams to those of its currently opened playlist element.
* @param s AVFormatContext of the concat-type demuxer, which contains the AVPlaylistContext and substreams.
+ * @return Returns 0 upon success, or negative upon failure.
*/
-void av_playlist_set_streams(AVFormatContext *s);
+int av_playlist_set_streams(AVFormatContext *s);
/** @brief Allocates and populates a new AVFormatContext for a concat-type demuxer.
* @param flist List of filenames from which to construct the playlist.
More information about the FFmpeg-soc
mailing list