[v2,2/5] rtsp: Simplify AVOption definitions

Message ID 1318504831-10325-2-git-send-email-martin@martin.st
State Committed
Commit 2c9aa0247d6a5654d955fb018a84e7f2ec3a355e
Headers show

Commit Message

Martin Storsjö Oct. 13, 2011, 11:20 a.m.
Use defines for shortening common parts, omit the .dbl named
initializer (since it's the first element in the union).
---
 libavformat/rtsp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Anton Khirnov Oct. 13, 2011, 3:25 p.m. | #1
On Thu, 13 Oct 2011 14:20:28 +0300, Martin Storsjö <martin@martin.st> wrote:
> Use defines for shortening common parts, omit the .dbl named
> initializer (since it's the first element in the union).
> ---
>  libavformat/rtsp.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 

Ok.

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 49c148c..e4c4c98 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -57,8 +57,10 @@ 
 #define SDP_MAX_SIZE 16384
 #define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH
 
+#define OFFSET(x) offsetof(RTSPState, x)
+#define DEC AV_OPT_FLAG_DECODING_PARAM
 const AVOption ff_rtsp_options[] = {
-    { "initial_pause",  "Don't start playing the stream immediately", offsetof(RTSPState, initial_pause), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { "initial_pause",  "Don't start playing the stream immediately", OFFSET(initial_pause), AV_OPT_TYPE_INT, {0}, 0, 1, DEC },
     FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
     { NULL },
 };