[MPlayer-cvslog] r32529 - trunk/command.c
reimar
subversion at mplayerhq.hu
Sat Oct 23 12:14:44 CEST 2010
Author: reimar
Date: Sat Oct 23 12:14:43 2010
New Revision: 32529
Log:
Simplify and fix capture feature to not always return an error.
Modified:
trunk/command.c
Modified: trunk/command.c
==============================================================================
--- trunk/command.c Fri Oct 22 22:39:43 2010 (r32528)
+++ trunk/command.c Sat Oct 23 12:14:43 2010 (r32529)
@@ -1118,18 +1118,20 @@ static int mp_property_capture(m_option_
if (!mpctx->stream)
return M_PROPERTY_UNAVAILABLE;
+ if (!capture_dump) {
+ mp_msg(MSGT_GLOBAL, MSGL_ERR,
+ "Capturing not enabled (forgot -capture parameter?)\n");
+ return M_PROPERTY_ERROR;
+ }
ret = m_property_flag(prop, action, arg, &capturing);
if (ret == M_PROPERTY_OK && capturing != !!mpctx->stream->capture_file) {
if (capturing) {
- if (capture_dump && !(mpctx->stream->capture_file = fopen(stream_dump_name, "wb"))) {
+ mpctx->stream->capture_file = fopen(stream_dump_name, "wb");
+ if (!mpctx->stream->capture_file) {
mp_msg(MSGT_GLOBAL, MSGL_ERR,
"Error opening capture file: %s\n", strerror(errno));
ret = M_PROPERTY_ERROR;
- } else {
- mp_msg(MSGT_GLOBAL, MSGL_ERR,
- "Capturing not enabled (forgot -capture parameter?)\n");
- ret = M_PROPERTY_ERROR;
}
} else {
fclose(mpctx->stream->capture_file);
More information about the MPlayer-cvslog
mailing list